jsonpath-rs unit test for 0.2.2

This commit is contained in:
freestrings 2019-06-19 16:17:58 +09:00
parent fff0e869cb
commit 488e0b400f
4 changed files with 84 additions and 84 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "jsonpath4nodejs" name = "jsonpath4nodejs"
version = "0.2.0" version = "0.2.2"
authors = ["Changseok Han <freestrings@gmail.com>"] authors = ["Changseok Han <freestrings@gmail.com>"]
description = "jsonpath_lib bindings for nodejs" description = "jsonpath_lib bindings for nodejs"
keywords = ["library", "jsonpath", "json", "nodejs"] keywords = ["library", "jsonpath", "json", "nodejs"]
@ -14,7 +14,7 @@ exclude = ["artifacts.json", "index.node"]
neon-build = "0.2.0" neon-build = "0.2.0"
[dependencies] [dependencies]
jsonpath_lib = "0.2.0" jsonpath_lib = "0.2.2"
#jsonpath_lib = { path = "../../" } #jsonpath_lib = { path = "../../" }
neon = "0.2.0" neon = "0.2.0"
neon-serde = "0.1.1" neon-serde = "0.1.1"

View File

@ -1,6 +1,6 @@
{ {
"name": "jsonpath-rs", "name": "jsonpath-rs",
"version": "0.2.0", "version": "0.2.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "jsonpath-rs", "name": "jsonpath-rs",
"version": "0.2.0", "version": "0.2.2",
"description": "It is JsonPath implementation. The core implementation is written in Rust", "description": "It is JsonPath implementation. The core implementation is written in Rust",
"author": "Changseok Han <freestrings@gmail.com>", "author": "Changseok Han <freestrings@gmail.com>",
"license": "MIT", "license": "MIT",

View File

@ -413,78 +413,78 @@ describe('filter test', () => {
} }
}); });
// it('escaped single quote notation', (done) => { it('escaped single quote notation', (done) => {
// let result = jsonpath.select({"single'quote":"value"}, "$['single\\'quote']"); let result = jsonpath.select({"single'quote":"value"}, "$['single\\'quote']");
// if (JSON.stringify(result) === JSON.stringify(["value"])) { if (JSON.stringify(result) === JSON.stringify(["value"])) {
// done(); done();
// } }
// }); });
//
// it('escaped double quote notation', (done) => { it('escaped double quote notation', (done) => {
// let result = jsonpath.select({"single\"quote":"value"}, "$['single\"quote']"); let result = jsonpath.select({"single\"quote":"value"}, "$['single\"quote']");
// if (JSON.stringify(result) === JSON.stringify(["value"])) { if (JSON.stringify(result) === JSON.stringify(["value"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[::]', (done) => { it('array range with step - $[::]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::]");
// if (JSON.stringify(result) === JSON.stringify(["first", "second", "third", "forth", "fifth"])) { if (JSON.stringify(result) === JSON.stringify(["first", "second", "third", "forth", "fifth"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[::2]', (done) => { it('array range with step - $[::2]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::2]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::2]");
// if (JSON.stringify(result) === JSON.stringify(["first", "third", "fifth"])) { if (JSON.stringify(result) === JSON.stringify(["first", "third", "fifth"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[1: :]', (done) => { it('array range with step - $[1: :]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1: :]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1: :]");
// if (JSON.stringify(result) === JSON.stringify(["second", "third", "forth", "fifth"])) { if (JSON.stringify(result) === JSON.stringify(["second", "third", "forth", "fifth"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[1:2:]', (done) => { it('array range with step - $[1:2:]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1:2:]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1:2:]");
// if (JSON.stringify(result) === JSON.stringify(["second"])) { if (JSON.stringify(result) === JSON.stringify(["second"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[1::2]', (done) => { it('array range with step - $[1::2]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1::2]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1::2]");
// if (JSON.stringify(result) === JSON.stringify(["second", "forth"])) { if (JSON.stringify(result) === JSON.stringify(["second", "forth"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[0:3:1]', (done) => { it('array range with step - $[0:3:1]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:1]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:1]");
// if (JSON.stringify(result) === JSON.stringify(["first", "second", "third"])) { if (JSON.stringify(result) === JSON.stringify(["first", "second", "third"])) {
// done(); done();
// } }
// }); });
//
// it('array range with step - $[0:3:2]', (done) => { it('array range with step - $[0:3:2]', (done) => {
// let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:2]"); let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:2]");
// if (JSON.stringify(result) === JSON.stringify(["first", "third"])) { if (JSON.stringify(result) === JSON.stringify(["first", "third"])) {
// done(); done();
// } }
// }); });
//
// it('array keys', (done) => { it('array keys', (done) => {
// let result = jsonpath.select({ let result = jsonpath.select({
// "key1": "value1", "key1": "value1",
// "key2": 2 "key2": 2
// }, "$['key1', 'key2']"); }, "$['key1', 'key2']");
// if (JSON.stringify(result) === JSON.stringify(["value1", 2])) { if (JSON.stringify(result) === JSON.stringify(["value1", 2])) {
// done(); done();
// } }
// }); });
}); });
describe('SelectorMut test', () => { describe('SelectorMut test', () => {
@ -886,11 +886,11 @@ describe('README test', () => {
}); });
}); });
// describe('ISSUE test', () => { describe('ISSUE test', () => {
// it('Results do not match other implementations #6', (done) => { it('Results do not match other implementations #6', (done) => {
// let result = jsonpath.select(["first", "second"], "$[:]"); let result = jsonpath.select(["first", "second"], "$[:]");
// if (JSON.stringify(result) === JSON.stringify(["first", "second"])) { if (JSON.stringify(result) === JSON.stringify(["first", "second"])) {
// done(); done();
// } }
// }); });
// }); });