-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathparser.js
More file actions
28 lines (24 loc) · 1017 Bytes
/
parser.js
File metadata and controls
28 lines (24 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
define([
"esquery",
"jstestr/assert",
"jstestr/test"
], function (esquery, assert, test) {
test.defineSuite("basic query parsing", {
"empty query": function () {
assert.isEqual(void 0, esquery.parse(""));
assert.isEqual(void 0, esquery.parse(" "));
},
"leading/trailing whitespace": function () {
assert.isNotEqual(void 0, esquery.parse(" A"));
assert.isNotEqual(void 0, esquery.parse(" A"));
assert.isNotEqual(void 0, esquery.parse("A "));
assert.isNotEqual(void 0, esquery.parse("A "));
assert.isNotEqual(void 0, esquery.parse(" A "));
assert.isNotEqual(void 0, esquery.parse(" A "));
},
"memoize selector parsing": function () {
assert.isEqual(JSON.stringify(esquery.parse("A")) === JSON.stringify(esquery.parse("A")), true);
assert.isEqual(esquery.parse("A") === esquery.parse("A"), true);
}
});
});