Skip to content

Commit

Permalink
a few more escaped selector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 27, 2012
1 parent c7b06bf commit 714a984
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions t/mojo/dom.t
Expand Up @@ -2,7 +2,7 @@ use Mojo::Base -strict;

use utf8;

use Test::More tests => 735;
use Test::More tests => 741;

# "Homer gave me a kidney: it wasn't his, I didn't need it,
# and it came postage due- but I appreciated the gesture!"
Expand Down Expand Up @@ -198,8 +198,14 @@ 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 = Mojo::DOM->new->parse('<div id="sno&quot;wman">☃</div>');
is $dom->at('[id="sno\"wman"]')->text, '', 'right text';
$dom = Mojo::DOM->new->parse('<div id="snowm&quot;an">☃</div>');
is $dom->at('[id="snowm\"an"]')->text, '', 'right text';
is $dom->at('[id="snowm\22 an"]')->text, '', 'right text';
is $dom->at('[id="snowm\000022an"]')->text, '', 'right text';
is $dom->at('[id="snowm\22an"]'), undef, 'no result';
is $dom->at('[id="snowm\21 an"]'), undef, 'no result';
is $dom->at('[id="snowm\000021an"]'), undef, 'no result';
is $dom->at('[id="snowm\000021 an"]'), undef, 'no result';

# Unicode and escaped selectors
my $unicode = encode 'UTF-8',
Expand Down

0 comments on commit 714a984

Please sign in to comment.