@@ -1040,28 +1040,28 @@ EOF
10401040 is_deeply \@li , [' F' ], ' found third last li element' ;
10411041 @li = ();
10421042 $dom -> find(' li:nth-child(1n+0)' )-> each (sub { push @li , shift -> text });
1043- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1043+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10441044 @li = ();
10451045 $dom -> find(' li:nth-child(1n-0)' )-> each (sub { push @li , shift -> text });
1046- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1046+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10471047 @li = ();
10481048 $dom -> find(' li:nth-child(n+0)' )-> each (sub { push @li , shift -> text });
1049- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1049+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10501050 @li = ();
10511051 $dom -> find(' li:nth-child(n)' )-> each (sub { push @li , shift -> text });
1052- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1052+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10531053 @li = ();
10541054 $dom -> find(' li:nth-child(n+0)' )-> each (sub { push @li , shift -> text });
1055- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1055+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10561056 @li = ();
10571057 $dom -> find(' li:NTH-CHILD(N+0)' )-> each (sub { push @li , shift -> text });
1058- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1058+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10591059 @li = ();
10601060 $dom -> find(' li:Nth-Child(N+0)' )-> each (sub { push @li , shift -> text });
1061- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1061+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10621062 @li = ();
10631063 $dom -> find(' li:nth-child(n)' )-> each (sub { push @li , shift -> text });
1064- is_deeply \@li , [qw( A B C D E F G) ], ' found all li elements' ;
1064+ is_deeply \@li , [qw( A B C D E F G H ) ], ' found all li elements' ;
10651065 @li = ();
10661066 $dom -> find(' li:nth-child(0n+1)' )-> each (sub { push @li , shift -> text });
10671067 is_deeply \@li , [qw( A) ], ' found first li element' ;
@@ -1102,19 +1102,19 @@ EOF
11021102 is_deeply \@e , [qw( A E H) ], ' found all odd li elements' ;
11031103 @e = ();
11041104 $dom -> find(' ul li:not(:first-child, :last-child)' )-> each (sub { push @e , shift -> text });
1105- is_deeply \@e , [qw( C E F H) ], ' found all odd li elements' ;
1105+ is_deeply \@e , [qw( C E F H) ], ' found all li elements but first/last ' ;
11061106 @e = ();
11071107 $dom -> find(' ul li:is(:first-child, :last-child)' )-> each (sub { push @e , shift -> text });
1108- is_deeply \@e , [qw( A I) ], ' found all odd li elements' ;
1108+ is_deeply \@e , [qw( A I) ], ' found first/last li elements' ;
11091109 @e = ();
11101110 $dom -> find(' li:nth-last-of-type( odd )' )-> each (sub { push @e , shift -> text });
1111- is_deeply \@e , [qw( C F I) ], ' found all odd li elements' ;
1111+ is_deeply \@e , [qw( C F I) ], ' found all odd li elements (counting from end) ' ;
11121112 @e = ();
11131113 $dom -> find(' p:nth-of-type(odd)' )-> each (sub { push @e , shift -> text });
11141114 is_deeply \@e , [qw( B G) ], ' found all odd p elements' ;
11151115 @e = ();
11161116 $dom -> find(' p:nth-last-of-type(odd)' )-> each (sub { push @e , shift -> text });
1117- is_deeply \@e , [qw( B G) ], ' found all odd li elements' ;
1117+ is_deeply \@e , [qw( B G) ], ' found all odd p elements (counting from end) ' ;
11181118 @e = ();
11191119 $dom -> find(' ul :nth-child(1)' )-> each (sub { push @e , shift -> text });
11201120 is_deeply \@e , [' A' ], ' found first child' ;
@@ -1193,6 +1193,9 @@ EOF
11931193 @e = ();
11941194 $dom -> find(' div div:only-of-type' )-> each (sub { push @e , shift -> text });
11951195 is_deeply \@e , [qw( J K) ], ' found only child' ;
1196+ @e = ();
1197+ $dom -> find(' div :nth-child(-n+2)' )-> each (sub { push @e , shift -> text });
1198+ is_deeply \@e , [qw( J Mojo! K) ], ' found first two children of each div' ;
11961199};
11971200
11981201subtest ' Links' => sub {
0 commit comments