diff --git a/nodejs/native/Cargo.toml b/nodejs/native/Cargo.toml index 74fd4b6..70f33a4 100644 --- a/nodejs/native/Cargo.toml +++ b/nodejs/native/Cargo.toml @@ -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"] } diff --git a/nodejs/test/index.spec.js b/nodejs/test/index.spec.js index 8a1760d..9d4721d 100644 --- a/nodejs/test/index.spec.js +++ b/nodejs/test/index.spec.js @@ -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(); + }); }); \ No newline at end of file