Bracket notation after recursive descent does not recurse #40

This commit is contained in:
freestrings
2020-03-21 18:40:11 +09:00
parent 67cc6447a8
commit 241a7f482d
2 changed files with 81 additions and 17 deletions

View File

@ -216,3 +216,38 @@ fn array_multiple_key() {
json!(["blue", "Leonor Herman"]),
);
}
#[test]
fn bugs40_bracket_notation_after_recursive_descent() {
setup();
select_and_then_compare(
"$..[0]",
json!([
"first",
{
"key": [
"first nested",
{
"more": [
{"nested": ["deepest", "second"]},
["more", "values"]
]
}
]
}
]),
json!([
"first",
"first nested",
{
"nested" : [
"deepest",
"second"
]
},
"deepest",
"more"
]),
);
}