Skip to content

Commit 8c91fdb

Browse files
committed
Add test for issue #2024 to t/mojo/dom.t
1 parent 7a1f891 commit 8c91fdb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/mojo/dom.t

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3100,4 +3100,16 @@ subtest 'Unknown CSS selector' => sub {
31003100
like $@, qr/Unknown CSS selector: p\[/, 'right error';
31013101
};
31023102

3103+
# Github Issue #2024
3104+
subtest 'Handle tab in selector' => sub {
3105+
my $dom = Mojo::DOM->new(<<EOF);
3106+
<!DOCTYPE html>
3107+
<ul> <li>Ax1</li> </ul>
3108+
EOF
3109+
for my $selector ("ul li", "ul\tli", "ul \tli", "ul\t li") {
3110+
is_deeply $dom->find($selector)->map(sub { $_->to_string })->to_array, ['<li>Ax1</li>'],
3111+
'selector "' . $selector =~ s/\t/\\t/r . '"';
3112+
}
3113+
};
3114+
31033115
done_testing();

0 commit comments

Comments
 (0)