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

Commit

Permalink
Merge pull request #205 from metafacture/102-integrationTestChangedBe…
Browse files Browse the repository at this point in the history
…haviourAddFieldLastWildcard

Add integration test for `add_field` with `$last` wildcard
  • Loading branch information
TobiasNx authored Mar 24, 2022
2 parents 6c5403c + 25c2c7b commit 8cc9eaa
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"animals" : [ {
"name" : "Jake",
"type" : "dog"
}, {
"name" : "Blacky",
"type" : "bird",
"key" : "value"
} ]
}
{
"animals" : [ ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"animals" : [
{
"name": "Jake",
"type": "dog"
},
{
"name": "Blacky",
"type": "bird"
}
]
}
{
"animals" : [ ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_field("animals[].$last.key", "value")
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 8cc9eaa

Please sign in to comment.