X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fselectors.t;h=8a800b1c6ecc0497d179ad0c3658b973c7fadfb1;hb=8af6dead371dda2793a0649592cfa0dcf905e5bc;hp=6dd32bd16c1ded0cb9235bdbda12d4859c031e9c;hpb=8c9ef555e2320515b20ac191100c9b13fc0863ee;p=catagits%2FHTML-Zoom.git
diff --git a/t/selectors.t b/t/selectors.t
index 6dd32bd..8a800b1 100644
--- a/t/selectors.t
+++ b/t/selectors.t
@@ -40,6 +40,14 @@ is( HTML::Zoom->from_html('
'.$stub)
'grg
'.$stub,
'E[attr] works' );
+# *[attr]
+is( HTML::Zoom->from_html(''.$stub)
+ ->select('*[frew]')
+ ->replace_content('grg')
+ ->to_html,
+ 'grg
grg'.$stub,
+ '*[attr] works' );
+
# el[attr="foo"]
is( HTML::Zoom->from_html(''.$stub)
->select('div[frew="yo"]')
@@ -55,7 +63,14 @@ is( HTML::Zoom->from_html(''.$stub)
->to_html,
'grg
'.$stub,
'E[attr=val] works' );
-
+
+# el[attr!="foo"]
+is( HTML::Zoom->from_html(''.$stub)
+ ->select('div[class!="waargh"]')
+ ->replace_content('grg')
+ ->to_html,
+ 'grg
grg
'.$stub,
+ 'E[attr!="val"] works' );
# el[attr*="foo"]
is( HTML::Zoom->from_html(''.$stub)
@@ -97,6 +112,16 @@ is( HTML::Zoom->from_html(''.$stub)
'grg
'.$stub,
'E[attr~="val"] works' );
+# el[attr|="foo"]
+is( HTML::Zoom->from_html(''.
+ ''.$stub)
+ ->select('div[lang|="en"]')
+ ->replace_content('grg')
+ ->to_html,
+ ''.
+ 'grg
grg
'.$stub,
+ 'E[attr|="val"] works' );
+
# [attr=bar]
ok( check_select( '[prop=moo]'), '[attr=bar]' );