Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Update asterisks test
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Feb 1, 2022
1 parent a8f314c commit 67a97dc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
6 changes: 6 additions & 0 deletions data/testing/asteriskArray/asteriskArray.fix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ set_array("TEST_TWO[]")
copy_field("test[].*", "TEST_TWO[].$append")
set_array("TEST_3[]")
copy_field("test[].*", "TEST_THREE[].$append")
prepend("nestedTest[].*.test[].*", "Number ")
set_array("TEST_5[]")
copy_field("coll[].*.b", "TEST_5[].$append")

replace_all("test[].*", "o", "__")
append("test[].*", " is cool")
replace_all("coll[].*.a", "o", "__")
prepend("coll[].*.a", "HELLO ")
replace_all("nestedTest[].*.test[].*", "o", "__")

lookup("animals[].*.Aanimal", "data/testing/asteriskArray/mapfile.tsv", "sep_char":"\t")

Expand All @@ -16,8 +20,10 @@ set_array("TEST_4[]")
copy_field("nestedTest[].*.test[].*", "TEST_4[].$append")
split_field("others[].*.tools","--")
sort_field("OTHERS[].*.dnimals[]")
add_field("coll[].*.c", "test")

# ----------These break:

# reverse("TEST_3[].*")
# reverse("ANIMALS[].*")

Expand Down
17 changes: 12 additions & 5 deletions data/testing/asteriskArray/expected.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"test" : [ "One is cool", "Tw__ is cool", "Three is cool" ],
"coll" : [ {
"a" : "HELLO D__g"
"a" : "HELLO D__g",
"b": "Dog",
"c": "test"
}, {
"a" : "HELLO Ape"
"a" : "HELLO Ape",
"b": "Ape",
"c": "test"
}, {
"a" : "HELLO Giraffe"
"a" : "HELLO Giraffe",
"c": "test"
}, {
"a" : "HELLO Cr__c__dile"
"a" : "HELLO Cr__c__dile",
"c": "test"
} ],
"others" : [ {
"name" : "Jake",
Expand Down Expand Up @@ -40,5 +46,6 @@
} ],
"TEST_TWO" : [ "One", "Two", "Three" ],
"TEST_3" : [ "enO", "owT", "eerhT" ],
"Test_4": [ "One", "Two", "Three", "4", "5", "6"]
"Test_4": [ "One", "Two", "Three", "4", "5", "6"],
"TEST_5" : [ "Dog", "Ape" ]
}
7 changes: 5 additions & 2 deletions data/testing/asteriskArray/result.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"test" : [ "One is cool", "Tw__ is cool", "Three is cool" ],
"nestedTest" : [ {
"test" : [ "One", "Two", "Three" ]
"test" : [ "Number One", "Number Tw__", "Number Three" ]
}, {
"test" : [ "4", "5", "6" ]
"test" : [ "Number 4", "Number 5", "Number 6" ]
} ],
"coll" : [ {
"b" : "Dog",
"a" : "HELLO D__g"
}, {
"b" : "Ape",
"a" : "HELLO Ape"
}, {
"a" : "HELLO Giraffe"
Expand Down Expand Up @@ -49,5 +51,6 @@
"2" : "Two",
"3" : "Three"
} ],
"TEST_5" : [ "Dog", "Ape" ],
"TEST_4" : [ ]
}
6 changes: 4 additions & 2 deletions data/testing/asteriskArray/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
],
"coll": [
{
"a": "Dog"
"a": "Dog",
"b": "Dog"
},
{
"a": "Ape"
"a": "Ape",
"b": "Ape"
},
{
"a": "Giraffe"
Expand Down

0 comments on commit 67a97dc

Please sign in to comment.