mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-04-25 09:22:19 +00:00
jsonpath-rs 0.2.3
This commit is contained in:
parent
13816df970
commit
6ad4432737
@ -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"] }
|
||||
|
@ -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();
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user