Skip to content

Commit

Permalink
Add more lookup related integration tests #160
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Mar 1, 2022
1 parent 42e5ee4 commit 20bc2d6
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"animals" : [ {
"name" : "Jake",
"type" : "mammal"
}, {
"name" : "Blacky",
"type" : "bird"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"animals": [{
"name": "Jake",
"type": "dog"
},{
"name": "Blacky",
"type": "parrot"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
put_map("map",
"dog":"mammal",
"cat":"mammal",
"parrot":"bird",
"shark":"fish",
"dragon":"ficational animal",
"unicorn":"ficational animal"
)

lookup("animals[].*.type", "map")
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" : [ {
"name" : "Jake",
"type" : "mammal"
}, {
"name" : "Blacky",
"type" : "bird"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"animals": [{
"name": "Jake",
"type": "dog"
},{
"name": "Blacky",
"type": "parrot"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
put_map("map",
"dog":"mammal",
"cat":"mammal",
"parrot":"bird",
"shark":"fish",
"dragon":"ficational animal",
"unicorn":"ficational animal"
)

do list(path: "animals[]")
lookup("type", "map")
end
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 @@
{
"animals" : [ "mammal", "bird", "fish" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"animals" : [ "dog", "parrot", "shark" ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
put_map("map",
"dog":"mammal",
"cat":"mammal",
"parrot":"bird",
"shark":"fish",
"dragon":"ficational animal",
"unicorn":"ficational animal"
)

lookup("animals[].*", "map")
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 20bc2d6

Please sign in to comment.