Results do not match other implementations - js unit test

This commit is contained in:
freestrings
2019-06-17 12:21:32 +09:00
parent b41b9f3aa6
commit 909c851dcc
6 changed files with 22 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "jsonpath_lib" name = "jsonpath_lib"
version = "0.2.0" version = "0.2.2"
authors = ["Changseok Han <freestrings@gmail.com>"] authors = ["Changseok Han <freestrings@gmail.com>"]
description = "It is JsonPath engine written in Rust. it provide a similar API interface in Webassembly and Javascript also. - Webassembly Demo: https://freestrings.github.io/jsonpath" description = "It is JsonPath engine written in Rust. it provide a similar API interface in Webassembly and Javascript also. - Webassembly Demo: https://freestrings.github.io/jsonpath"

View File

@ -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

@ -798,3 +798,12 @@ 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();
}
});
});

View File

@ -377,7 +377,7 @@ impl Parser {
debug!("#range_to"); debug!("#range_to");
match tokenizer.peek_token() { match tokenizer.peek_token() {
Ok(Token::CloseArray(_)) => { Ok(Token::CloseArray(_)) => {
return Ok(Self::node(ParseToken::Range(None, None))) return Ok(Self::node(ParseToken::Range(None, None)));
} }
_ => {} _ => {}
} }

View File

@ -1,6 +1,6 @@
[package] [package]
name = "jsonpath-wasm" name = "jsonpath-wasm"
version = "0.2.1" version = "0.2.2"
authors = ["Changseok Han <freestrings@gmail.com>"] authors = ["Changseok Han <freestrings@gmail.com>"]
description = "It is Webassembly version of jsonpath_lib that is JsonPath engine written in Rust - Demo: https://freestrings.github.io/jsonpath" description = "It is Webassembly version of jsonpath_lib that is JsonPath engine written in Rust - Demo: https://freestrings.github.io/jsonpath"
keywords = ["jsonpath", "json", "webassembly", "parsing", "rust"] keywords = ["jsonpath", "json", "webassembly", "parsing", "rust"]

View File

@ -822,3 +822,12 @@ 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();
}
});
});