Skip to content

Commit

Permalink
Test that destructuring preserves original input.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 committed Oct 28, 2024
1 parent 4560c86 commit d9b91b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jaq-core/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ yields!(
1
);

yields!(
pat_orig,
"[{a:123}] | .[0] as {$a} | [., $a]",
json!([[{"a": 123}], 123])
);

yields!(pat_arr0, "[] as [$x] | $x", json!(null));
yields!(pat_arr1, "[1, 2, 3] as [$x] | $x", 1);
yields!(pat_arr2, "[1, 2, 3] as [$x, $y] | [$x, $y]", [1, 2]);
Expand Down

0 comments on commit d9b91b8

Please sign in to comment.