Skip to content

Commit

Permalink
Add integration test for is_array() #247
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Jul 15, 2022
1 parent 158737e commit 29065de
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"elementA" : "Test"
}
{
"elementA" : [ "Test", "Another Test" ],
"elementB" : "Hello"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim">
<record>
<elementA>Test</elementA>
</record>
<record>
<elementA>Test</elementA>
<elementA>Another Test</elementA>
</record>
</collection>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if is_array("elementA")
add_field("elementB", "Hello")
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FLUX_DIR + "input.xml"
|open-file
|decode-xml
|handle-marcxml
|fix(FLUX_DIR + "test.fix")
|encode-json(prettyPrinting="true")
|write(FLUX_DIR + "output-metafix.json")
;

0 comments on commit 29065de

Please sign in to comment.