This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for different behaviour with asterisk
- Loading branch information
Showing
6 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -------These work | ||
set_array("TEST_TWO[]") | ||
copy_field("test[].*", "TEST_TWO[].$append") | ||
set_array("TEST_3[]") | ||
copy_field("test[].*", "TEST_THREE[].$append") | ||
|
||
replace_all("test[].*", "o", "__") | ||
append("test[].*", " is cool") | ||
replace_all("coll[].*.a", "o", "__") | ||
prepend("coll[].*.a", "HELLO ") | ||
|
||
lookup("animals[].*.Aanimal", "data/testing/asteriskArray/mapfile.tsv", "sep_char":"\t") | ||
|
||
# ----------These do nothing | ||
set_array("TEST_4[]") | ||
copy_field("nestedTest[].*.test[].*", "TEST_4[].$append") | ||
split_field("others[].*.tools","--") | ||
sort_field("OTHERS[].*.dnimals[]") | ||
|
||
# ----------These break: | ||
# reverse("TEST_3[].*") | ||
# reverse("ANIMALS[].*") | ||
|
||
# sum("OTHERS[].*.dumbers[]") | ||
|
||
# rename("OTHERS[].*", "d", "XY") |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FLUX_DIR + "test.json" | ||
|open-file | ||
| as-records | ||
| decode-json | ||
| fix(FLUX_DIR + "asteriskArray.fix") | ||
| encode-json(prettyPrinting="True") | ||
| write(FLUX_DIR + "result.json") | ||
; |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"test" : [ "One is cool", "Tw__ is cool", "Three is cool" ], | ||
"coll" : [ { | ||
"a" : "HELLO D__g" | ||
}, { | ||
"a" : "HELLO Ape" | ||
}, { | ||
"a" : "HELLO Giraffe" | ||
}, { | ||
"a" : "HELLO Cr__c__dile" | ||
} ], | ||
"others" : [ { | ||
"name" : "Jake", | ||
"animal" : "dog", | ||
"tools" : [ | ||
{"1": "magic", | ||
"2": "arms", | ||
"3": "shapeShifting"} | ||
] | ||
}, { | ||
"name" : "Finn", | ||
"animal" : "human", | ||
"tools" : [ | ||
{"1": "sword", | ||
"2": "anotherSword", | ||
"3": "arm"} | ||
] | ||
} ], | ||
"OTHERS" : [ { | ||
"name" : "Jake", | ||
"dnimals" : [ "cat", "dog", "zebra" ], | ||
"dumbers" : [ "20" ] | ||
} ], | ||
"animals" : [ { | ||
"name" : "Jake", | ||
"Aanimal" : "mammal" | ||
}, { | ||
"name" : "Blacky", | ||
"Aanimal" : "bird" | ||
} ], | ||
"TEST_TWO" : [ "One", "Two", "Three" ], | ||
"TEST_3" : [ "enO", "owT", "eerhT" ], | ||
"Test_4": [ "One", "Two", "Three", "4", "5", "6"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dog mammal | ||
cat mammal | ||
parrot bird | ||
shark fish | ||
dragon ficational animal | ||
unicorn ficational animal |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"test" : [ "One is cool", "Tw__ is cool", "Three is cool" ], | ||
"nestedTest" : [ { | ||
"test" : [ "One", "Two", "Three" ] | ||
}, { | ||
"test" : [ "4", "5", "6" ] | ||
} ], | ||
"coll" : [ { | ||
"a" : "HELLO D__g" | ||
}, { | ||
"a" : "HELLO Ape" | ||
}, { | ||
"a" : "HELLO Giraffe" | ||
}, { | ||
"a" : "HELLO Cr__c__dile" | ||
} ], | ||
"others" : [ { | ||
"name" : "Jake", | ||
"animal" : "dog", | ||
"tools" : "magic--arms--shapeShifting" | ||
}, { | ||
"name" : "Finn", | ||
"animal" : "human", | ||
"tools" : "sword--anotherSword--arm" | ||
} ], | ||
"OTHERS" : [ { | ||
"name" : "Jake", | ||
"dnimals" : [ "dog", "zebra", "cat" ], | ||
"dumbers" : [ "7", "2", "1", "10" ] | ||
} ], | ||
"animals" : [ { | ||
"name" : "Jake", | ||
"Aanimal" : "mammal" | ||
}, { | ||
"name" : "Blacky", | ||
"Aanimal" : "bird" | ||
} ], | ||
"ANIMALS" : [ { | ||
"Aanimal" : "dog", | ||
"name" : "Jake" | ||
}, { | ||
"Aanimal" : "parrot", | ||
"name" : "Blacky" | ||
} ], | ||
"TEST_TWO" : [ "One", "Two", "Three" ], | ||
"TEST_3" : [ ], | ||
"TEST_THREE" : [ { | ||
"1" : "One", | ||
"2" : "Two", | ||
"3" : "Three" | ||
} ], | ||
"TEST_4" : [ ] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"test": [ | ||
"One", | ||
"Two", | ||
"Three" | ||
], | ||
"nestedTest": [ | ||
{ | ||
"test": [ | ||
"One", | ||
"Two", | ||
"Three" | ||
] | ||
}, | ||
{ | ||
"test": [ | ||
"4", | ||
"5", | ||
"6" | ||
] | ||
} | ||
], | ||
"coll": [ | ||
{ | ||
"a": "Dog" | ||
}, | ||
{ | ||
"a": "Ape" | ||
}, | ||
{ | ||
"a": "Giraffe" | ||
}, | ||
{ | ||
"a": "Crocodile" | ||
} | ||
], | ||
"others": [ | ||
{ | ||
"name": "Jake", | ||
"animal": "dog", | ||
"tools": "magic--arms--shapeShifting" | ||
}, | ||
{ | ||
"name": "Finn", | ||
"animal": "human", | ||
"tools": "sword--anotherSword--arm" | ||
} | ||
], | ||
"OTHERS": [ | ||
{ | ||
"name": "Jake", | ||
"dnimals": [ | ||
"dog", | ||
"zebra", | ||
"cat" | ||
], | ||
"dumbers": [ | ||
"7", | ||
"2", | ||
"1", | ||
"10" | ||
] | ||
} | ||
], | ||
"animals": [ | ||
{ | ||
"name": "Jake", | ||
"Aanimal": "dog" | ||
}, | ||
{ | ||
"name": "Blacky", | ||
"Aanimal": "parrot" | ||
} | ||
], | ||
"ANIMALS": [ | ||
{ | ||
"Aanimal": "dog", | ||
"name": "Jake" | ||
}, | ||
{ | ||
"Aanimal": "parrot", | ||
"name": "Blacky" | ||
} | ||
] | ||
} |