mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-12 23:51:26 +00:00
support iterator
This commit is contained in:
178
tests/paths.rs
178
tests/paths.rs
@ -12,104 +12,104 @@ fn dolla_token_in_path() {
|
||||
select_and_then_compare(
|
||||
"$..$ref",
|
||||
json!({
|
||||
"Junk1": "This is a test to illustrate use of '$' in the attr for the expression $..['$ref'] ",
|
||||
"$ref": "Match Root",
|
||||
"Subset1":[
|
||||
{"Junk2": "Data...",
|
||||
"$ref": "Match Subset1"
|
||||
}
|
||||
],
|
||||
"hierachy1":{
|
||||
"hierachy2.1":{
|
||||
"hierachy2.1.1":{ "$ref":"Match 2.1.1"},
|
||||
"hierachy2.1.2":{ "ref":"Match 2.1.2"},
|
||||
"hierachy2.1.3":{ "ref":"No Match 2.1.3"},
|
||||
"hierachy2.1.4":{ "$ref":"Match 2.1.4"},
|
||||
"hierachy2.1.5":{ "ref":"No Match 2.1.5"}
|
||||
},
|
||||
"hierachy2.2":{
|
||||
"hierachy2.2.1":{ "ref":"No Match 2.2.1"},
|
||||
"hierachy2.2.2":{ "$ref":"Match 2.2.2"},
|
||||
"hierachy2.2.3":{ "ref":"No Match 2.2.3"},
|
||||
"hierachy2.2.4":{ "ref":"No Match 2.2.5"},
|
||||
"hierachy2.2.5":{ "$ref":"Match 2.2.5"}
|
||||
},
|
||||
"hierachy2.3":{
|
||||
"hierachy2.3.1":{ "ref":"No Match 2.3.1"},
|
||||
"hierachy2.3.2":{ "ref":"No Match 2.3.2"},
|
||||
"hierachy2.3.3":{ "ref":"No Match 2.3.3"},
|
||||
"hierachy2.3.4":{ "ref":"No Match 2.3.4"},
|
||||
"hierachy2.3.5":{ "ref":"No Match 2.3.5"},
|
||||
"hierachy2.3.6":{
|
||||
"hierachy2.3.6.1":{ "$ref":"Match 2.3.6.1"},
|
||||
"hierachy2.3.6.2":{ "ref":"No Match 2.3.6.2"},
|
||||
"hierachy2.3.6.3":{ "ref":"No Match 2.3.6.3"},
|
||||
"hierachy2.3.6.4":{ "ref":"No Match 2.3.6.4"},
|
||||
"hierachy2.3.6.5":{ "ref":"No Match 2.3.6.5"}
|
||||
}
|
||||
}
|
||||
"Junk1": "This is a test to illustrate use of '$' in the attr for the expression $..['$ref'] ",
|
||||
"$ref": "Match Root",
|
||||
"Subset1":[
|
||||
{"Junk2": "Data...",
|
||||
"$ref": "Match Subset1"
|
||||
}
|
||||
}),
|
||||
],
|
||||
"hierachy1":{
|
||||
"hierachy2.1":{
|
||||
"hierachy2.1.1":{ "$ref":"Match 2.1.1"},
|
||||
"hierachy2.1.2":{ "ref":"Match 2.1.2"},
|
||||
"hierachy2.1.3":{ "ref":"No Match 2.1.3"},
|
||||
"hierachy2.1.4":{ "$ref":"Match 2.1.4"},
|
||||
"hierachy2.1.5":{ "ref":"No Match 2.1.5"}
|
||||
},
|
||||
"hierachy2.2":{
|
||||
"hierachy2.2.1":{ "ref":"No Match 2.2.1"},
|
||||
"hierachy2.2.2":{ "$ref":"Match 2.2.2"},
|
||||
"hierachy2.2.3":{ "ref":"No Match 2.2.3"},
|
||||
"hierachy2.2.4":{ "ref":"No Match 2.2.5"},
|
||||
"hierachy2.2.5":{ "$ref":"Match 2.2.5"}
|
||||
},
|
||||
"hierachy2.3":{
|
||||
"hierachy2.3.1":{ "ref":"No Match 2.3.1"},
|
||||
"hierachy2.3.2":{ "ref":"No Match 2.3.2"},
|
||||
"hierachy2.3.3":{ "ref":"No Match 2.3.3"},
|
||||
"hierachy2.3.4":{ "ref":"No Match 2.3.4"},
|
||||
"hierachy2.3.5":{ "ref":"No Match 2.3.5"},
|
||||
"hierachy2.3.6":{
|
||||
"hierachy2.3.6.1":{ "$ref":"Match 2.3.6.1"},
|
||||
"hierachy2.3.6.2":{ "ref":"No Match 2.3.6.2"},
|
||||
"hierachy2.3.6.3":{ "ref":"No Match 2.3.6.3"},
|
||||
"hierachy2.3.6.4":{ "ref":"No Match 2.3.6.4"},
|
||||
"hierachy2.3.6.5":{ "ref":"No Match 2.3.6.5"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
json!([
|
||||
"Match Root",
|
||||
"Match Subset1",
|
||||
"Match 2.1.1",
|
||||
"Match 2.1.4",
|
||||
"Match 2.2.2",
|
||||
"Match 2.2.5",
|
||||
"Match 2.3.6.1"
|
||||
"Match Root",
|
||||
"Match Subset1",
|
||||
"Match 2.1.1",
|
||||
"Match 2.1.4",
|
||||
"Match 2.2.2",
|
||||
"Match 2.2.5",
|
||||
"Match 2.3.6.1"
|
||||
]),
|
||||
);
|
||||
|
||||
select_and_then_compare(
|
||||
"$..['$ref']",
|
||||
json!({
|
||||
"Junk1": "This is a test to illustrate use of '$' in the attr for the expression $..['$ref'] ",
|
||||
"$ref": "Match Root",
|
||||
"Subset1":[
|
||||
{"Junk2": "Data...",
|
||||
"$ref": "Match Subset1"
|
||||
}
|
||||
],
|
||||
"hierachy1":{
|
||||
"hierachy2.1":{
|
||||
"hierachy2.1.1":{ "$ref":"Match 2.1.1"},
|
||||
"hierachy2.1.2":{ "ref":"Match 2.1.2"},
|
||||
"hierachy2.1.3":{ "ref":"No Match 2.1.3"},
|
||||
"hierachy2.1.4":{ "$ref":"Match 2.1.4"},
|
||||
"hierachy2.1.5":{ "ref":"No Match 2.1.5"}
|
||||
},
|
||||
"hierachy2.2":{
|
||||
"hierachy2.2.1":{ "ref":"No Match 2.2.1"},
|
||||
"hierachy2.2.2":{ "$ref":"Match 2.2.2"},
|
||||
"hierachy2.2.3":{ "ref":"No Match 2.2.3"},
|
||||
"hierachy2.2.4":{ "ref":"No Match 2.2.5"},
|
||||
"hierachy2.2.5":{ "$ref":"Match 2.2.5"}
|
||||
},
|
||||
"hierachy2.3":{
|
||||
"hierachy2.3.1":{ "ref":"No Match 2.3.1"},
|
||||
"hierachy2.3.2":{ "ref":"No Match 2.3.2"},
|
||||
"hierachy2.3.3":{ "ref":"No Match 2.3.3"},
|
||||
"hierachy2.3.4":{ "ref":"No Match 2.3.4"},
|
||||
"hierachy2.3.5":{ "ref":"No Match 2.3.5"},
|
||||
"hierachy2.3.6":{
|
||||
"hierachy2.3.6.1":{ "$ref":"Match 2.3.6.1"},
|
||||
"hierachy2.3.6.2":{ "ref":"No Match 2.3.6.2"},
|
||||
"hierachy2.3.6.3":{ "ref":"No Match 2.3.6.3"},
|
||||
"hierachy2.3.6.4":{ "ref":"No Match 2.3.6.4"},
|
||||
"hierachy2.3.6.5":{ "ref":"No Match 2.3.6.5"}
|
||||
}
|
||||
}
|
||||
"Junk1": "This is a test to illustrate use of '$' in the attr for the expression $..['$ref'] ",
|
||||
"$ref": "Match Root",
|
||||
"Subset1":[
|
||||
{"Junk2": "Data...",
|
||||
"$ref": "Match Subset1"
|
||||
}
|
||||
}),
|
||||
],
|
||||
"hierachy1":{
|
||||
"hierachy2.1":{
|
||||
"hierachy2.1.1":{ "$ref":"Match 2.1.1"},
|
||||
"hierachy2.1.2":{ "ref":"Match 2.1.2"},
|
||||
"hierachy2.1.3":{ "ref":"No Match 2.1.3"},
|
||||
"hierachy2.1.4":{ "$ref":"Match 2.1.4"},
|
||||
"hierachy2.1.5":{ "ref":"No Match 2.1.5"}
|
||||
},
|
||||
"hierachy2.2":{
|
||||
"hierachy2.2.1":{ "ref":"No Match 2.2.1"},
|
||||
"hierachy2.2.2":{ "$ref":"Match 2.2.2"},
|
||||
"hierachy2.2.3":{ "ref":"No Match 2.2.3"},
|
||||
"hierachy2.2.4":{ "ref":"No Match 2.2.5"},
|
||||
"hierachy2.2.5":{ "$ref":"Match 2.2.5"}
|
||||
},
|
||||
"hierachy2.3":{
|
||||
"hierachy2.3.1":{ "ref":"No Match 2.3.1"},
|
||||
"hierachy2.3.2":{ "ref":"No Match 2.3.2"},
|
||||
"hierachy2.3.3":{ "ref":"No Match 2.3.3"},
|
||||
"hierachy2.3.4":{ "ref":"No Match 2.3.4"},
|
||||
"hierachy2.3.5":{ "ref":"No Match 2.3.5"},
|
||||
"hierachy2.3.6":{
|
||||
"hierachy2.3.6.1":{ "$ref":"Match 2.3.6.1"},
|
||||
"hierachy2.3.6.2":{ "ref":"No Match 2.3.6.2"},
|
||||
"hierachy2.3.6.3":{ "ref":"No Match 2.3.6.3"},
|
||||
"hierachy2.3.6.4":{ "ref":"No Match 2.3.6.4"},
|
||||
"hierachy2.3.6.5":{ "ref":"No Match 2.3.6.5"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
json!([
|
||||
"Match Root",
|
||||
"Match Subset1",
|
||||
"Match 2.1.1",
|
||||
"Match 2.1.4",
|
||||
"Match 2.2.2",
|
||||
"Match 2.2.5",
|
||||
"Match 2.3.6.1"
|
||||
"Match Root",
|
||||
"Match Subset1",
|
||||
"Match 2.1.1",
|
||||
"Match 2.1.4",
|
||||
"Match 2.2.2",
|
||||
"Match 2.2.5",
|
||||
"Match 2.3.6.1"
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user