jsonpath-rs 0.2.3

This commit is contained in:
freestrings 2019-06-24 14:32:27 +09:00
parent 13816df970
commit 6ad4432737
2 changed files with 32 additions and 32 deletions

View File

@ -14,7 +14,7 @@ exclude = ["artifacts.json", "index.node"]
neon-build = "0.2.0"
[dependencies]
jsonpath_lib = "0.2.2"
jsonpath_lib = "0.2.3"
#jsonpath_lib = { path = "../../" }
neon = "0.2.0"
serde_json = { version = "1.0", features = ["preserve_order"] }

View File

@ -894,35 +894,35 @@ describe('ISSUE test', () => {
}
});
// it('Invalid wildcard filter results #7', (done) => {
//
// function select(json, expected, paths) {
// for (var i = 0 ; i < paths.length ; i++) {
// let result = jsonpath.select(json, paths[i]);
// if (JSON.stringify(result) !== JSON.stringify(expected)) {
// throw Error("Error: " + paths[i]);
// }
// }
// }
//
// select(
// ["string", 42, { "key": "value" }, [0, 1]],
// ["string", 42, { "key": "value" }, [0, 1]],
// ["$.*", "$[*]"]
// );
//
// select(
// ["string", 42, { "key": "value" }, [0, 1]],
// [ "string", 42, { "key" : "value" }, [ 0, 1 ], "value", 0, 1 ],
// ["$..*", "$..[*]"]
// );
//
// select(
// ["string", 42, { "key": "value" }, [0, 1]],
// ["value", 0, 1],
// ["$.*.*", "$[*].*", "$.*[*]", "$[*][*]"]
// );
//
// done();
// });
it('Invalid wildcard filter results #7', (done) => {
function select(json, expected, paths) {
for (var i = 0 ; i < paths.length ; i++) {
let result = jsonpath.select(json, paths[i]);
if (JSON.stringify(result) !== JSON.stringify(expected)) {
throw Error("Error: " + paths[i]);
}
}
}
select(
["string", 42, { "key": "value" }, [0, 1]],
["string", 42, { "key": "value" }, [0, 1]],
["$.*", "$[*]"]
);
select(
["string", 42, { "key": "value" }, [0, 1]],
[ "string", 42, { "key" : "value" }, [ 0, 1 ], "value", 0, 1 ],
["$..*", "$..[*]"]
);
select(
["string", 42, { "key": "value" }, [0, 1]],
["value", 0, 1],
["$.*.*", "$[*].*", "$.*[*]", "$[*][*]"]
);
done();
});
});