Skip to content

Commit

Permalink
Split integration test into two #127 and #377
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Oct 15, 2024
1 parent 06b39e0 commit 0309e67
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rswk" : [ {
"subjectTopicName" : "Nonprofit organizations"
}, {
"subjectTopicName" : "Nonprofit organizations",
"subjectGenre" : "Case studies"
} ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<collection xmlns="http://www.loc.gov/MARC21/slim">
<record>
<datafield tag="650" ind1=" " ind2=" ">
<subfield code="a">Nonprofit organizations</subfield>
<subfield code="x">Management.</subfield>
</datafield>
<datafield tag="650" ind1=" " ind2=" ">
<subfield code="a">Nonprofit organizations</subfield>
<subfield code="x">Management</subfield>
<subfield code="v">Case studies.</subfield>
</datafield>
</record>
</collection>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
do list(path: "650??", "var": "$i")
copy_field("$i.a", "rswk[].$append.subjectTopicName")
copy_field("$i.v", "rswk[].$last.subjectGenre")
end
replace_all("rswk[].*.subjectGenre", "[.]$", "")

retain("rswk[]")
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")
;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See #377 . This behaviour seems to be undetected or new after #369
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@
}, {
"subjectTopicName" : "Nonprofit organizations",
"subjectGenre" : "Case studies"
} ],
"rswk" : [ {
"subjectTopicName" : "Nonprofit organizations"
}, {
"subjectTopicName" : "Nonprofit organizations",
"subjectGenre" : "Case studies"
} ]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,4 @@ do list(path: "650??", "var": "$i")
end
replace_all("RSWK[].*.subjectGenre", "[.]$", "")

do list(path: "650??", "var": "$i")
copy_field("$i.a", "rswk[].$append.subjectTopicName")
copy_field("$i.v", "rswk[].$last.subjectGenre")
end
replace_all("rswk[].*.subjectGenre", "[.]$", "")

retain("RSWK[]","rswk[]")
retain("RSWK[]")

0 comments on commit 0309e67

Please sign in to comment.