Skip to content

Commit eebc3e1

Browse files
committed
test: add an empty node to the sample tree
1 parent 2e2e8ab commit eebc3e1

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

test/lib/ast.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,15 @@
497497
"value": "MIT"
498498
}
499499
]
500+
},
501+
{
502+
"type": "div",
503+
"children": [
504+
{
505+
"type": "div",
506+
"children": []
507+
}
508+
]
500509
}
501510
]
502-
}
511+
}

test/select.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,14 @@ test('structural pseudo-classes', function (t) {
165165
path(ast, [10, 2, 1]),
166166
path(ast, [10, 2, 2])
167167
]);
168-
t.deepEqual(select(ast, 'definition:nth-last-child(odd)')
168+
t.deepEqual(select(ast, 'definition:nth-last-child(even)')
169169
.map(function (node) { return node.identifier }),
170170
['viverra', 'interdum']);
171+
t.deepEqual(select(ast,
172+
':root > :nth-last-child(n+2):nth-last-child(-n+3)'), [
173+
path(ast, [16]),
174+
path(ast, [17])
175+
]);
171176
t.end();
172177
});
173178

0 commit comments

Comments
 (0)