File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -22,28 +22,28 @@ fn main() {
2222 let json_obj = json! ({
2323 " school" : {
2424 " friends" : [
25- {" name" : " 친구1 " , " age" : 20 },
26- {" name" : " 친구2 " , " age" : 20 }
25+ {" name" : " foo1 " , " age" : 20 },
26+ {" name" : " foo2 " , " age" : 20 }
2727 ]
2828 },
2929 " friends" : [
30- {" name" : " 친구3 " , " age" : 30 },
31- {" name" : " 친구4 " }
30+ {" name" : " foo3 " , " age" : 30 },
31+ {" name" : " foo4 " }
3232 ]
3333 });
3434
3535 let json = calculator . calc (& json_obj );
3636
3737 assert_eq! (json , vec! [
38- & json! ({" name" : " 친구3 " , " age" : 30 }),
39- & json! ({" name" : " 친구1 " , " age" : 20 })
38+ & json! ({" name" : " foo3 " , " age" : 30 }),
39+ & json! ({" name" : " foo1 " , " age" : 20 })
4040 ]);
4141}
4242```
4343
4444### Tests
4545` jsonpath_calculator ` pass ** Almost** all the tests on https://github.com/freestrings/jsonpath , to run the tests:
4646
47- ```
47+ ``` rust
4848cargo test
4949```
Original file line number Diff line number Diff line change @@ -32,20 +32,20 @@ use json_path::{
3232/// let json_obj = json!({
3333/// "school": {
3434/// "friends": [
35- /// {"name": "친구1 ", "age": 20},
36- /// {"name": "친구2 ", "age": 20}
35+ /// {"name": "foo1 ", "age": 20},
36+ /// {"name": "foo2 ", "age": 20}
3737/// ]
3838/// },
3939/// "friends": [
40- /// {"name": "친구3 ", "age": 30},
41- /// {"name": "친구4 "}
40+ /// {"name": "foo3 ", "age": 30},
41+ /// {"name": "foo4 "}
4242/// ]});
4343///
4444/// let json = calculator.calc(&json_obj);
4545///
4646/// assert_eq!(json, vec![
47- /// &json!({"name": "친구3 ", "age": 30}),
48- /// &json!({"name": "친구1 ", "age": 20})
47+ /// &json!({"name": "foo3 ", "age": 30}),
48+ /// &json!({"name": "foo1 ", "age": 20})
4949/// ]);
5050/// ```
5151pub fn create < ' i > ( query : & ' i Query < ' i > ) -> PathCalculator < ' i , DummyTrackerGenerator > {
You can’t perform that action at this time.
0 commit comments