From 2e0f78f01713045614a1f7a210b770ad08e389f7 Mon Sep 17 00:00:00 2001 From: freestrings Date: Tue, 18 Jun 2019 13:38:11 +0900 Subject: [PATCH] =?UTF-8?q?0.2.2=20=EB=B0=B0=ED=8F=AC=20=EC=A0=84=EA=B9=8C?= =?UTF-8?q?=EC=A7=80=20jsonpath-rs=20unit=20test=20=EC=9E=84=EC=8B=9C=20?= =?UTF-8?q?=EB=A1=A4=EB=B0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nodejs/native/Cargo.toml | 2 +- nodejs/test/index.spec.js | 160 +++++++++++++++++++------------------- 2 files changed, 81 insertions(+), 81 deletions(-) diff --git a/nodejs/native/Cargo.toml b/nodejs/native/Cargo.toml index 37e3440..2c52d00 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.0" #jsonpath_lib = { path = "../../" } neon = "0.2.0" neon-serde = "0.1.1" diff --git a/nodejs/test/index.spec.js b/nodejs/test/index.spec.js index 4d95835..eff1496 100644 --- a/nodejs/test/index.spec.js +++ b/nodejs/test/index.spec.js @@ -413,78 +413,78 @@ describe('filter test', () => { } }); - it('escaped single quote notation', (done) => { - let result = jsonpath.select({"single'quote":"value"}, "$['single\\'quote']"); - if (JSON.stringify(result) === JSON.stringify(["value"])) { - done(); - } - }); - - it('escaped double quote notation', (done) => { - let result = jsonpath.select({"single\"quote":"value"}, "$['single\"quote']"); - if (JSON.stringify(result) === JSON.stringify(["value"])) { - done(); - } - }); - - it('array range with step - $[::]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::]"); - if (JSON.stringify(result) === JSON.stringify(["first", "second", "third", "forth", "fifth"])) { - done(); - } - }); - - it('array range with step - $[::2]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::2]"); - if (JSON.stringify(result) === JSON.stringify(["first", "third", "fifth"])) { - done(); - } - }); - - it('array range with step - $[1: :]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1: :]"); - if (JSON.stringify(result) === JSON.stringify(["second", "third", "forth", "fifth"])) { - done(); - } - }); - - it('array range with step - $[1:2:]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1:2:]"); - if (JSON.stringify(result) === JSON.stringify(["second"])) { - done(); - } - }); - - it('array range with step - $[1::2]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1::2]"); - if (JSON.stringify(result) === JSON.stringify(["second", "forth"])) { - done(); - } - }); - - it('array range with step - $[0:3:1]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:1]"); - if (JSON.stringify(result) === JSON.stringify(["first", "second", "third"])) { - done(); - } - }); - - it('array range with step - $[0:3:2]', (done) => { - let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:2]"); - if (JSON.stringify(result) === JSON.stringify(["first", "third"])) { - done(); - } - }); - - it('array keys', (done) => { - let result = jsonpath.select({ - "key1": "value1", - "key2": 2 - }, "$['key1', 'key2']"); - if (JSON.stringify(result) === JSON.stringify(["value1", 2])) { - done(); - } - }); + // it('escaped single quote notation', (done) => { + // let result = jsonpath.select({"single'quote":"value"}, "$['single\\'quote']"); + // if (JSON.stringify(result) === JSON.stringify(["value"])) { + // done(); + // } + // }); + // + // it('escaped double quote notation', (done) => { + // let result = jsonpath.select({"single\"quote":"value"}, "$['single\"quote']"); + // if (JSON.stringify(result) === JSON.stringify(["value"])) { + // done(); + // } + // }); + // + // it('array range with step - $[::]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::]"); + // if (JSON.stringify(result) === JSON.stringify(["first", "second", "third", "forth", "fifth"])) { + // done(); + // } + // }); + // + // it('array range with step - $[::2]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[::2]"); + // if (JSON.stringify(result) === JSON.stringify(["first", "third", "fifth"])) { + // done(); + // } + // }); + // + // it('array range with step - $[1: :]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1: :]"); + // if (JSON.stringify(result) === JSON.stringify(["second", "third", "forth", "fifth"])) { + // done(); + // } + // }); + // + // it('array range with step - $[1:2:]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1:2:]"); + // if (JSON.stringify(result) === JSON.stringify(["second"])) { + // done(); + // } + // }); + // + // it('array range with step - $[1::2]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[1::2]"); + // if (JSON.stringify(result) === JSON.stringify(["second", "forth"])) { + // done(); + // } + // }); + // + // it('array range with step - $[0:3:1]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:1]"); + // if (JSON.stringify(result) === JSON.stringify(["first", "second", "third"])) { + // done(); + // } + // }); + // + // it('array range with step - $[0:3:2]', (done) => { + // let result = jsonpath.select(["first", "second", "third", "forth", "fifth"], "$[0:3:2]"); + // if (JSON.stringify(result) === JSON.stringify(["first", "third"])) { + // done(); + // } + // }); + // + // it('array keys', (done) => { + // let result = jsonpath.select({ + // "key1": "value1", + // "key2": 2 + // }, "$['key1', 'key2']"); + // if (JSON.stringify(result) === JSON.stringify(["value1", 2])) { + // done(); + // } + // }); }); describe('SelectorMut test', () => { @@ -886,11 +886,11 @@ describe('README test', () => { }); }); -describe('ISSUE test', () => { - it('Results do not match other implementations #6', (done) => { - let result = jsonpath.select(["first", "second"], "$[:]"); - if (JSON.stringify(result) === JSON.stringify(["first", "second"])) { - done(); - } - }); -}); \ No newline at end of file +// describe('ISSUE test', () => { +// it('Results do not match other implementations #6', (done) => { +// let result = jsonpath.select(["first", "second"], "$[:]"); +// if (JSON.stringify(result) === JSON.stringify(["first", "second"])) { +// done(); +// } +// }); +// }); \ No newline at end of file