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

Commit

Permalink
Add integration test for #132
Browse files Browse the repository at this point in the history
Also one for #121
  • Loading branch information
TobiasNx committed Mar 1, 2022
1 parent a25eeb4 commit 3edd595
Show file tree
Hide file tree
Showing 39 changed files with 293 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See issue #132 may also be related to #113
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test" : [ {
"key" : "value_1"
}, {
"key" : "value_2"
}, {
"key" : "value_3",
"animal_string_Array" : [ "dog", "elefant", "shark" ]
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test": [{
"key": "value_1"
},{
"key": "value_2"
},{
"key": "value_3"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
copy_field("test[]", "repeatedTest")
copy_field("animal_string_Array[]", "test[].$last.animal_string_Array[]")
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,4 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test" : [ "dog", "elefant", "shark" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"animal_string_Array" : [
"dog",
"elefant",
"shark"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copy_field("animal_string_Array[]", "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,6 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"animals_repeated_SimpleField" : "dog",
"animals_repeated_SimpleField" : "elefant",
"animals_repeated_SimpleField" : "shark"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"animal_string_Array" : [
"dog",
"elefant",
"shark"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
copy_field("animal_string_Array[]", "animals_repeated_SimpleField")
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,20 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test" : [ {
"key": "value_1",
"animal_string_Array" : [ "dog", "elefant", "shark" ]
}, {
"key": "value_2",
"animal_string_Array" : [ "dog", "elefant", "shark" ]
}, {
"key": "value_3",
"animal_string_Array" : [ "dog", "elefant", "shark" ]
} ],
"test_2" : [ {
"key" : "value_1"
}, {
"key" : "value_2"
}, {
"key" : "value_3"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"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 @@
copy_field("animal_string_Array[]", "test[].*.animal_string_Array[]")
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 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test" : [ {
"key" : "value_1",
"animal_string_Array" : [ "dog", "elefant", "shark" ]
}, {
"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,17 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"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,2 @@
copy_field("animal_string_Array[]", "test[].$first.animal_string_Array[]")

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,20 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test" : [ {
"key" : "value_1",
"animals_repeated_SimpleField" : "dog",
"animals_repeated_SimpleField" : "elefant",
"animals_repeated_SimpleField" : "shark"
}, {
"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,17 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"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,2 @@
copy_field("animal_string_Array[]", "test[].$first.animals_repeated_SimpleField")

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,11 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"test" : [ {
"key" : "value_1"
}, {
"key" : "value_2"
}, {
"key" : "value_3",
"animal_string_Array" : [ "dog", "elefant", "shark" ]
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"animal_string_Array" : [ "dog", "elefant", "shark" ],
"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("animal_string_Array[]", "test[].$last.animal_string_Array[]")
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,10 @@
{
"animal_string_Array": [
"dog",
"elefant"
],
"animal_object_Array": [
{"name":"dog"},
{"name":"elefant"}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"test" : [ "dog", "elefant", "shark" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"animal_string_Array" : [
"dog",
"elefant",
"shark"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
move_field("animal_string_Array[]", "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,5 @@
{
"animals_repeated_SimpleField" : "dog",
"animals_repeated_SimpleField" : "elefant",
"animals_repeated_SimpleField" : "shark"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"animal_string_Array" : [
"dog",
"elefant",
"shark"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
move_field("animal_string_Array[]", "animals_repeated_SimpleField")
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")
;

0 comments on commit 3edd595

Please sign in to comment.