Created
May 20, 2011 14:04
-
-
Save sharifulin/982949 to your computer and use it in GitHub Desktop.
Mojo::DOM bug: TR recursion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use ojo; | |
use Test::More tests => 2; | |
my $ok = q( | |
<table class="post_table"> | |
<xtr> | |
<td> | |
<table class="reply_table"> | |
<tr> | |
<td class="info"> | |
<div class="wall_reply_text">Test</div> | |
</td> | |
</tr> | |
</table> | |
</td> | |
</xtr> | |
</table> | |
); | |
x( $ok )->find('.reply_table')->each(sub { | |
is shift->at('.wall_reply_text')->text, 'Test', 'Not recursion'; | |
}); | |
# fail | |
my $fail = q( | |
<table class="post_table"> | |
<tr> | |
<td> | |
<table class="reply_table"> | |
<tr> | |
<td class="info"> | |
<div class="wall_reply_text">Test</div> | |
</td> | |
</tr> | |
</table> | |
</td> | |
</tr> | |
</table> | |
); | |
x( $fail )->find('.reply_table')->each(sub { | |
is eval { shift->at('.wall_reply_text')->text }, 'Test', 'TR recursion'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment