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

Commit

Permalink
Add more 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 73be683 commit 45fb04d
Show file tree
Hide file tree
Showing 19 changed files with 118 additions and 8 deletions.
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,11 @@
{
"adventureDuo": [ {
"name" : "Jake",
"animal" : "dog",
"tools" : [ "arms", "magic", "shapeShifting" ]
}, {
"name" : "Finn",
"animal" : "human",
"tools" : [ "anotherSword", "arm", "sword" ]
} ]
}
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,2 @@
sort_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,9 @@
{
"animals" : [ "cat", "cat", "dog", "zebra" ],
"animals_2" : [ "zebra", "dog", "cat", "cat" ],
"animals_3" : [ "cat", "dog", "zebra" ],
"numbers" : [ "1", "10", "2", "7", "7" ],
"numbers_2" : [ "1", "2", "7", "7", "10" ],
"numbers_3" : [ "10", "7", "7", "2", "1" ],
"numbers_4" : [ "1", "2", "7", "10" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"animals" : [ "dog", "cat", "cat", "zebra" ],
"animals_2" : [ "dog", "cat", "cat", "zebra" ],
"animals_3" : [ "dog", "cat", "cat", "zebra" ],
"numbers" : [ "7", "2", "7", "1", "10" ],
"numbers_2" : [ "7", "2", "7", "1", "10" ],
"numbers_3" : [ "7", "2", "7", "1", "10" ],
"numbers_4" : [ "7", "2", "7", "1", "10" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sort_field("animals[]")
sort_field("numbers[]")
sort_field("numbers_2[]",numeric:"true")
sort_field("animals_2[]",reverse:"true")
sort_field("numbers_3[]", numeric:"true",reverse:"true")
sort_field("animals_3[]", uniq:"true")
sort_field("numbers_4[]",numeric:"true", uniq:"true")
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,11 +1,11 @@
{
"adventureDuo": [ {
"name" : "Jake",
"animal" : "dog",
"tools" : "magic--arms--shapeShifting"
}, {
"name" : "Finn",
"animal" : "human",
"tools" : "sword--anotherSword--arm"
} ]
"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,4 @@
{
"numbers" : [ "27" ],
"numbers_2" : [ "10" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"numbers" : [ "7", "2", "7", "1", "10" ],
"numbers_2" : [ "1", "2", "3", "4"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sum("numbers[]")
sum("numbers_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 @@
See issue #121
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"objects" : [ {
"numbers" : [ "27" ]
}, {
"numbers" : [ "10"]
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"objects" : [ {
"numbers" : [ "7", "2", "7", "1", "10" ]
}, {
"numbers_2" : [ "1", "2", "3", "4"]
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sum("objects[].*.numbers[]")

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 45fb04d

Please sign in to comment.