@@ -16,7 +16,7 @@ test('edge cases', function (t) {
1616
1717test ( 'type selector' , function ( t ) {
1818 t . equal ( select ( ast , 'root' ) . length , 1 ) ;
19- t . equal ( select ( ast , 'root' ) [ 0 ] , ast ) ;
19+ t . deepEqual ( select ( ast , 'root' ) , [ ast ] ) ;
2020 t . equal ( select ( ast , 'text' ) . length , 39 ) ;
2121 t . equal ( select ( ast , 'text' ) [ 1 ] , ast . children [ 1 ] . children [ 0 ] ) ;
2222 t . equal ( select ( ast , 'tableRow' ) . length , 2 ) ;
@@ -127,6 +127,23 @@ test('attribute selectors', function (t) {
127127} ) ;
128128
129129
130+ test ( 'structural pseudo-classes' , function ( t ) {
131+ t . test ( ':root' , function ( t ) {
132+ t . deepEqual ( select ( ast , ':root' ) , [ ast ] ) ;
133+ t . deepEqual ( select ( ast , ':root:root' ) , [ ast ] ) ;
134+ t . deepEqual ( select ( ast , '* :root' ) , [ ] ) ;
135+ t . deepEqual ( select ( ast , 'text:not(:root)' ) , select ( ast , 'text' ) ) ;
136+ t . deepEqual ( select ( ast , ':root > list' ) , [
137+ path ( ast , [ 4 ] ) ,
138+ path ( ast , [ 6 ] )
139+ ] ) ;
140+ t . end ( ) ;
141+ } ) ;
142+
143+ t . end ( ) ;
144+ } ) ;
145+
146+
130147test ( 'negation pseudo-class' , function ( t ) {
131148 t . deepEqual ( select ( ast , 'list:not([nonexistent])' ) , select ( ast , 'list' ) ) ;
132149 t . deepEqual ( select ( ast , 'list:not([start=null])' ) ,
0 commit comments