-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ghislain Fourny
committed
Jul 10, 2024
1 parent
bc94ae5
commit 831ed82
Showing
10 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Scripting/ApplyStatementWithUpdate5.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(:JIQS: ShouldRun; Output="[ 9, 5, 7, 8, 6 ]" :) | ||
variable $je := [1 to 4]; | ||
(delete json $je[[1]], delete json $je[[3]], replace value of json $je[[2]] with 5, replace json value of $je[[4]] with 6, insert json 7 into $je at position 4, insert json 8 into $je at position 4, insert json 9 into $je at position 1); | ||
(delete json $je[[1]], delete json $je[[3]], replace value of json $je[[2]] with 5, replace value of json $je[[4]] with 6, insert json 7 into $je at position 4, insert json 8 into $je at position 4, insert json 9 into $je at position 1); | ||
$je |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Scripting/ApplyStatementWithUpdateErr2.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(:JIQS: ShouldCrash; ErrorCode="JNUP0009"; ErrorMetadata="LINE:3:COLUMN:1:" :) | ||
variable $je := [1 to 4]; | ||
(replace value of json $je[[1]] with "foo", replace json value of $je[[1]] with "bar"); | ||
(replace value of json $je[[1]] with "foo", replace value of json $je[[1]] with "bar"); | ||
$je | ||
|
||
(: replace at same array with same selector :) |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Updating/MultipleUpdatesArray5.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(:JIQS: ShouldRun; Output="[ 9, 5, 7, 8, 6 ]" :) | ||
copy $je := [1 to 4] | ||
modify (delete json $je[[1]], delete json $je[[3]], replace value of json $je[[2]] with 5, replace json value of $je[[4]] with 6, insert json 7 into $je at position 4, insert json 8 into $je at position 4, insert json 9 into $je at position 1) | ||
modify (delete json $je[[1]], delete json $je[[3]], replace value of json $je[[2]] with 5, replace value of json $je[[4]] with 6, insert json 7 into $je at position 4, insert json 8 into $je at position 4, insert json 9 into $je at position 1) | ||
return $je |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Updating/MultipleUpdatesObject4.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(:JIQS: ShouldRun; Output="{ "a" : 4, "e" : 5, "g" : 6, "f" : 7 }" :) | ||
copy $je := {"a": 1, "b": 2, "c": 3, "d": 4} | ||
modify (insert json "e": 5 into $je, replace value of json $je.a with 4, rename json $je.b as "f", replace json value of $je.b with 7, delete json $je.c, delete json $je.d, insert json "g" : 6 into $je) | ||
modify (insert json "e": 5 into $je, replace value of json $je.a with 4, rename json $je.b as "f", replace value of json $je.b with 7, delete json $je.c, delete json $je.d, insert json "g" : 6 into $je) | ||
return $je |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(:JIQS: ShouldCrash; ErrorCode="JNUP0009"; ErrorMetadata="LINE:3:COLUMN:8:" :) | ||
copy $je := { "a" : 1, "b" : 2, "c" : 3 } | ||
modify (replace value of json $je.a with "foo", replace json value of $je.a with "bar") | ||
modify (replace value of json $je.a with "foo", replace value of json $je.a with "bar") | ||
return $je | ||
|
||
(: replace at same object with same selector :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(:JIQS: ShouldCrash; ErrorCode="JNUP0009"; ErrorMetadata="LINE:3:COLUMN:8:" :) | ||
copy $je := [1 to 4] | ||
modify (replace value of json $je[[1]] with "foo", replace json value of $je[[1]] with "bar") | ||
modify (replace value of json $je[[1]] with "foo", replace value of json $je[[1]] with "bar") | ||
return $je | ||
|
||
(: replace at same array with same selector :) |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Updating/SimpleReplaceErr1.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(:JIQS: ShouldCrash; ErrorCode="XUST0001"; ErrorMetadata="LINE:3:COLUMN:7:" :) | ||
copy $je := {"foo": "bar", "foobar": "barfoo"} | ||
modify replace value of json $je.foo with (replace json value of $je.foo with "foo") | ||
modify replace value of json $je.foo with (replace value of json $je.foo with "foo") | ||
return $je | ||
|
||
(: source expr is not simple :) |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Updating/SimpleReplaceErr2.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
(:JIQS: ShouldCrash; ErrorCode="XUST0001"; ErrorMetadata="LINE:3:COLUMN:7:" :) | ||
copy $je := {"foo": "bar", "foobar": "barfoo"} | ||
modify replace value of json (replace json value of $je.foo with "foo").foo with "foo" | ||
modify replace value of json (replace value of json $je.foo with "foo").foo with "foo" | ||
return $je | ||
|
||
(: target expr is not simple :) |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Updating/SimpleReplaceInArray2.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(:JIQS: ShouldRun; Output="[ 1, 2, 5, 6 ]" :) | ||
copy $je := [1 to 4] | ||
modify (replace value of json $je[[3]] with 5, replace json value of $je[[4]] with 6) | ||
modify (replace value of json $je[[3]] with 5, replace value of json $je[[4]] with 6) | ||
return $je |
2 changes: 1 addition & 1 deletion
2
src/test/resources/test_files/runtime/Updating/SimpleReplaceInObject2.jq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(:JIQS: ShouldRun; Output="{ "foobar" : "foobar", "foo" : "foo" }" :) | ||
copy $je := {"foo": "bar", "foobar": "barfoo"} | ||
modify (replace value of json $je.foo with "foo", replace json value of $je."foobar" with "foobar") | ||
modify (replace value of json $je.foo with "foo", replace value of json $je."foobar" with "foobar") | ||
return $je |