diff --git a/data/testing/prependArrays_strings/animalsStrings.json b/data/testing/prependArrays_strings/animalsStrings.json new file mode 100644 index 0000000..40b83ca --- /dev/null +++ b/data/testing/prependArrays_strings/animalsStrings.json @@ -0,0 +1,8 @@ +{ + "animals":[ + "dog", + "cat" + ], + "others": "human", + "fictional": "unicorn" +} \ No newline at end of file diff --git a/data/testing/prependArrays_strings/expected_string.json b/data/testing/prependArrays_strings/expected_string.json new file mode 100644 index 0000000..ce08088 --- /dev/null +++ b/data/testing/prependArrays_strings/expected_string.json @@ -0,0 +1,10 @@ +{ + "animals": [ + "earthworm", + "unicorn", + "human", + "dog", + "cat" + ], + "others": "human" +} \ No newline at end of file diff --git a/data/testing/prependArrays_strings/result_string.json b/data/testing/prependArrays_strings/result_string.json new file mode 100644 index 0000000..ae6da81 --- /dev/null +++ b/data/testing/prependArrays_strings/result_string.json @@ -0,0 +1,10 @@ +{ + "animals" : [ "dog", "cat", { + "$prepend" : "human" + }, { + "$prepend" : "unicorn" + }, { + "$prepend" : "earthworm" + } ], + "others" : "human" +} diff --git a/data/testing/prependArrays_strings/test_prepend_string.fix b/data/testing/prependArrays_strings/test_prepend_string.fix new file mode 100644 index 0000000..47a27f2 --- /dev/null +++ b/data/testing/prependArrays_strings/test_prepend_string.fix @@ -0,0 +1,5 @@ +copy_field("others", "animals[].$prepend") + +move_field("fictional", "animals[].$prepend") + +add_field("animals[].$prepend", "earthworm") \ No newline at end of file diff --git a/data/testing/prependArrays_strings/test_prepend_string.flux b/data/testing/prependArrays_strings/test_prepend_string.flux new file mode 100644 index 0000000..c0cfc49 --- /dev/null +++ b/data/testing/prependArrays_strings/test_prepend_string.flux @@ -0,0 +1,10 @@ +infile = FLUX_DIR + "animalsStrings.json"; + +infile +| open-file +| as-records +| decode-json +| fix(FLUX_DIR + "test_prepend_string.fix") +| encode-json(prettyPrinting="true") +| write(FLUX_DIR + "result_string.json") +; \ No newline at end of file