Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Update and add integration tests for #121
Browse files Browse the repository at this point in the history
and for the functions that are discussed in #121
  • Loading branch information
TobiasNx committed Mar 2, 2022
1 parent 92954a0 commit 73be683
Show file tree
Hide file tree
Showing 71 changed files with 398 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"investigators" : "Justus?Peter?Bob"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"investigators" : [ "Justus", "Peter", "Bob" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
join_field("investigators[]","?")
move_field("investigators[]","investigators")
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"object" : {
"__key" : "word",
"key" : "word",
"key_2" : "word_2",
"__bject" : {
"key_3" : "word_3",
"array##fStrings" : [ "test", "test_2", "test_3" ]
},
"array##f##bjects" : [ {
"key_4" : "word_4",
"array##fStrings_2" : [ "test", "test_2", "test_3" ]
}, {
"__key_2" : "word_2",
"array##fStrings" : [ "test", "test_2", "test_3" ]
} ]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"object" : {
"okey" : "word",
"key" : "word",
"key_2" : "word_2",
"object" : {
"key_3" : "word_3",
"arrayOfStrings" : [ "test", "test_2", "test_3" ]
},
"arrayOfObjects" : [ {
"key_4" : "word_4",
"arrayOfStrings_2" : [ "test", "test_2", "test_3" ]
}, {
"okey_2" : "word_2",
"arrayOfStrings" : [ "test", "test_2", "test_3" ]
} ]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rename("object", "o", "__")
rename("object", "O", "##")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
replace_all("key[].*", "o", "__")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"key" : [ {
"foo" : "bar",
"word" : "value"
}, {
"foo" : "bar",
"word" : "m__re_value"
}, {
"foo" : "bar",
"word" : "even_m__re_value"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"key" : [ {
"word" : "value",
"foo" : "bar"
}, {
"word" : "more_value",
"foo" : "bar"
}, {
"word" : "even_more_value",
"foo" : "bar"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
replace_all("key[].*.word", "o", "__")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"key" : "b__ard"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"key" : "board"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
replace_all("key", "o", "__")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See issue #121
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"animals" : [ "zebra", "cat", "dog" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"animals" : [ "dog", "cat", "zebra" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reverse("animals[]")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"animal" : "ynnub",
"animal_2" : {
"name" : "bird",
"type" : "TSET"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"animal": "bunny",
"animal_2": {
"name": "bird",
"type": "TEST"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
reverse("animal")
reverse("animal_2.test")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See issue #121
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"test": [{
"key": "1_eulav",
"test": "test_1"
},{
"key": "2_eulav",
"test": "test_2"
},{
"key": "3_eulav",
"test": "test_3"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"test": [{
"key": "value_1",
"test": "test_1"
},{
"key": "value_2",
"test": "test_2"
},{
"key": "value_3",
"test": "test_3"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reverse("test[].*.key")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See issue #121
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"animals" : [ "god", "tac", "arbez" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"animals": [ "dog", "cat", "zebra" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reverse("animals[].*")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tools" : "magic",
"tools" : "arms",
"tools" : "shapeShifting"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"tools" : "magic--arms--shapeShifting"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
split_field("tools", "--")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See issue #121
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"adventureDuo" : [ {
"name" : "Jake",
"animal" : "dog",
"tools" : "magic",
"tools" : "arms",
"tools" : "shapeShifting"
}, {
"name" : "Finn",
"animal" : "human",
"tools" : "sword",
"tools" : "anotherSword",
"tools" : "arm"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"adventureDuo": [ {
"name" : "Jake",
"animal" : "dog",
"tools" : "magic--arms--shapeShifting"
}, {
"name" : "Finn",
"animal" : "human",
"tools" : "sword--anotherSword--arm"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
split_field("adventureDuo[].*.tools", "--")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"people" : {
"investigators" : "Justus",
"investigators" : "Peter",
"investigators" : "Bob"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"people" : {
"investigators" : "Justus?Peter?Bob"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
split_field("people.investigators","\\?")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
See issue #156
See issue #156 and #121
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"test" : [ {
"key" : "value_1"
}, {
"key" : "value_2"
}, {
"key" : "value_3"
} ],
"test_2" : [ {
"key" : "value_1"
}, {
"key" : "value_2"
}, {
"key" : "value_3"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"test": [{
"key": "value_1"
},{
"key": "value_2"
},{
"key": "value_3"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copy_field("test[]", "test_2[]")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.json"
|open-file
|as-records
|decode-json
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"test" : [ {
"key" : "value_1"
}, {
"key" : "value_2"
}, {
"key" : "value_3"
} ],
"repeatedTest" : {
"key" : "value_1"
},
"repeatedTest" : {
"key" : "value_2"
},
"repeatedTest" : {
"key" : "value_3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"test": [{
"key": "value_1"
},{
"key": "value_2"
},{
"key": "value_3"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copy_field("test[]", "repeatedTest")
Loading

0 comments on commit 73be683

Please sign in to comment.