test for broken void elements
[catagits/HTML-Zoom.git] / t / selectors.t
index 9933e43..09875ad 100644 (file)
@@ -96,6 +96,17 @@ ok( check_select( '[prop=moo]'), '[attr=bar]' );
 is( check_select('span[class=career],[prop=moo]'), 2,
     'Multiple selectors: el[attr=bar],[attr=foo]');
 
+
+# selector parse error test:
+eval{
+    HTML::Zoom->from_html('<span att="bar"></span>')
+      ->select('[att=bar')
+      ->replace_content('cats')
+          ->to_html;
+};
+like( $@, qr/Error parsing dispatch specification/,
+      'Malformed attribute selector ([att=bar) results in a helpful error' );
+
 =pod
 
 # sel1 sel2
@@ -115,6 +126,8 @@ is( HTML::Zoom->from_html('<table><tr><td></td></tr><tr><td></td></tr></table>')
    '<table><tr><td>frew</td></tr><tr><td>frew</td></tr></table>',
    'sel1 sel2 sel3 works' );
 
+
+
 =cut
 
 done_testing;