Improved the test case - test tokens against expected values.

This commit is contained in:
Ondřej Španěl 2017-02-16 12:51:53 +01:00
parent 84adda7c20
commit 4394fe7dcf

View File

@ -14,8 +14,10 @@ describe("Accessor tokens", function() {
// test there are no nodes without tokens // test there are no nodes without tokens
var checkWalker = new UglifyJS.TreeWalker(function(node, descend) { var checkWalker = new UglifyJS.TreeWalker(function(node, descend) {
assert(node.start !== undefined); if (node instanceof UglifyJS.AST_Accessor) {
assert(node.end !== undefined); assert.equal(node.start.pos, 12);
assert.equal(node.end.endpos, 46);
}
}); });
ast.walk(checkWalker); ast.walk(checkWalker);
}); });