Skip to content

Instantly share code, notes, and snippets.

@2shortplanks
Created December 31, 2010 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2shortplanks/929ef1375a5a02b4f15d to your computer and use it in GitHub Desktop.
Save 2shortplanks/929ef1375a5a02b4f15d to your computer and use it in GitHub Desktop.
diff --git a/t/mojo/dom.t b/t/mojo/dom.t
index cc7205b..1f679df 100644
--- a/t/mojo/dom.t
+++ b/t/mojo/dom.t
@@ -5,7 +5,7 @@ use warnings;
use utf8;
-use Test::More tests => 317;
+use Test::More tests => 323;
# Homer gave me a kidney: it wasn't his, I didn't need it,
# and it came postage due- but I appreciated the gesture!
@@ -178,6 +178,15 @@ is $dom->at('[foo="bar"]')->text, 'works', 'right text';
is $dom->at('[foo="ba"]'), undef, 'no result';
is $dom->at('.tset')->text, 'works', 'right text';
+# Entities for delimiters
+$dom->parse(qq/<DIV id=&quot;test&quot; foo=&apos;bar&apos; class=&#39;tset&#39; answer=&#34;42&#34;>works<\/DIV>/);
+is $dom->at('#test')->text, 'works', 'right text';
+is $dom->at('div')->text, 'works', 'right text';
+is $dom->at('[foo="bar"]')->text, 'works', 'right text';
+is $dom->at('[answer="42"]')->text, 'works', 'right text';
+is $dom->at('[foo="ba"]'), undef, 'no result';
+is $dom->at('.tset')->text, 'works', 'right text';
+
# Already decoded unicode snowman and quotes in selector
$dom->parse('<div id="sno&quot;wman"><E2><98><83></div>');
is $dom->at('[id="sno\"wman"]')->text, '<E2><98><83>', 'right text';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment