mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-14 08:31:25 +00:00
SelectorMut WASM 적용
This commit is contained in:
@ -8,6 +8,7 @@ use serde_json::Value;
|
||||
|
||||
use self::jsonpath::Selector;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn setup() {
|
||||
let _ = env_logger::try_init();
|
||||
}
|
||||
|
@ -8,6 +8,8 @@ use serde_json::Value;
|
||||
|
||||
use jsonpath::{Selector, SelectorMut};
|
||||
|
||||
mod common;
|
||||
|
||||
#[test]
|
||||
fn readme() {
|
||||
let json_obj = json!({
|
||||
@ -407,6 +409,26 @@ fn readme_delete() {
|
||||
]}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn readme_delete2() {
|
||||
let json_obj = common::read_json("./benches/example.json");
|
||||
|
||||
let ret = jsonpath::delete(json_obj, "$.store.book").unwrap();
|
||||
|
||||
println!("{:?}", ret);
|
||||
|
||||
assert_eq!(ret, json!({
|
||||
"store": {
|
||||
"book": null,
|
||||
"bicycle": {
|
||||
"color": "red",
|
||||
"price": 19.95
|
||||
}
|
||||
},
|
||||
"expensive": 10
|
||||
}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn readme_replace_with() {
|
||||
let json_obj = json!({
|
||||
|
Reference in New Issue
Block a user