@@ -177,6 +177,7 @@ test('structural pseudo-classes', function (t) {
177
177
} ) ;
178
178
179
179
t . test ( ':first-child' , function ( t ) {
180
+ t . deepEqual ( select ( ast , ':first-child' ) , select ( ast , ':nth-child(1)' ) ) ;
180
181
t . deepEqual ( select ( ast , ':root:first-child' ) , [ ] ) ;
181
182
t . deepEqual ( select ( ast , 'heading:first-child' ) , [ path ( ast , [ 0 ] ) ] ) ;
182
183
t . deepEqual ( select ( ast , 'list listItem:first-child [value]:first-child' ) , [
@@ -189,6 +190,7 @@ test('structural pseudo-classes', function (t) {
189
190
} ) ;
190
191
191
192
t . test ( ':last-child' , function ( t ) {
193
+ t . deepEqual ( select ( ast , ':last-child' ) , select ( ast , ':nth-last-child(1)' ) ) ;
192
194
t . deepEqual ( select ( ast , ':root:last-child' ) , [ ] ) ;
193
195
t . deepEqual ( select ( ast , 'tableCell:last-child *' )
194
196
. map ( function ( node ) { return node . value } ) ,
@@ -197,6 +199,8 @@ test('structural pseudo-classes', function (t) {
197
199
} ) ;
198
200
199
201
t . test ( ':only-child' , function ( t ) {
202
+ t . deepEqual ( select ( ast , ':only-child' ) ,
203
+ select ( ast , ':first-child:last-child' ) ) ;
200
204
t . deepEqual ( select ( ast , ':root:only-child' ) , [ ] ) ;
201
205
t . deepEqual ( select ( ast , 'table:only-child' ) , [ ] ) ;
202
206
t . deepEqual ( select ( ast , ':root > *:not(paragraph) > text:only-child' )
0 commit comments