2 #use warnings FATAL => 'all';
10 <span prop='moo' class="hilight name">Bob</span>
11 <span class="career">Builder</span>
18 is( HTML::Zoom->from_html('<div id="yo"></div>')
20 ->replace_content('grg')
22 '<div id="yo">grg</div>',
26 is( HTML::Zoom->from_html('<div class="yo"></div>')
28 ->replace_content('grg')
30 '<div class="yo">grg</div>',
34 is( HTML::Zoom->from_html('<div frew="yo"></div>')
36 ->replace_content('grg')
38 '<div frew="yo">grg</div>',
42 is( HTML::Zoom->from_html('<div frew="yo"></div>')
43 ->select('div[frew="yo"]')
44 ->replace_content('grg')
46 '<div frew="yo">grg</div>',
47 'E[attr="val"] works' );
50 is( HTML::Zoom->from_html('<div frew="yo"></div>')
51 ->select('div[frew=yo]')
52 ->replace_content('grg')
54 '<div frew="yo">grg</div>',
55 'E[attr=val] works' );
59 is( HTML::Zoom->from_html('<div f="frew goog"></div>')
60 ->select('div[f*="oo"]')
61 ->replace_content('grg')
63 '<div f="frew goog">grg</div>',
64 'E[attr*="val"] works' );
67 is( HTML::Zoom->from_html('<div f="foobar"></div>')
68 ->select('div[f^="foo"]')
69 ->replace_content('grg')
71 '<div f="foobar">grg</div>',
72 'E[attr^="val"] works' );
75 is( HTML::Zoom->from_html('<div f="foobar"></div>')
76 ->select('div[f$="bar"]')
77 ->replace_content('grg')
79 '<div f="foobar">grg</div>',
80 'E[attr$="val"] works' );
83 is( HTML::Zoom->from_html('<div f="foo bar"></div>')
84 ->select('div[f*="bar"]')
85 ->replace_content('grg')
87 '<div f="foo bar">grg</div>',
88 'E[attr*="val"] works' );
91 ok( check_select( '[prop=moo]'), '[attr=bar]' );
93 # el[attr=bar],[prop=foo]
94 is( check_select('span[class=career],[prop=moo]'), 2,
95 'Multiple selectors: el[attr=bar],[attr=foo]');
99 is( HTML::Zoom->from_html('<table><tr></tr><tr></tr></table>')
101 ->replace_content(\'<td></td>')
103 '<table><tr><td></td></tr><tr><td></td></tr></table>',
108 is( HTML::Zoom->from_html('<table><tr><td></td></tr><tr><td></td></tr></table>')
109 ->select('table tr td')
110 ->replace_content('frew')
112 '<table><tr><td>frew</td></tr><tr><td>frew</td></tr></table>',
113 'sel1 sel2 sel3 works' );
120 my $output = HTML::Zoom
122 ->select(shift)->replace("the monkey")->to_html;
124 while ( $output =~ /\G?.*the monkey/gc ){