This repository has been archived by the owner on Jan 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failing integration test for asterisk in
replace_all()
with rep…
- Loading branch information
1 parent
4324378
commit cb4f27e
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...d/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"RSWK" : [ { | ||
"subjectTopicName" : "Nonprofit organizations" | ||
}, { | ||
"subjectTopicName" : "Nonprofit organizations", | ||
"subjectGenre" : "Case studies" | ||
} ] | ||
} |
14 changes: 14 additions & 0 deletions
14
...ethod/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/input.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
7 changes: 7 additions & 0 deletions
7
...method/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/test.fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set_array("RSWK[]") | ||
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[]") |
8 changes: 8 additions & 0 deletions
8
...ethod/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/test.flux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
; |
1 change: 1 addition & 0 deletions
1
...method/fromXml/toJson/replace_allInOptionalSubfieldOfRepeatedObjectsWithAsterisk/todo.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
See PR #170 |