Skip to content

Commit d611014

Browse files
committed
Add integration test for #278
1 parent 0390880 commit d611014

File tree

9 files changed

+97
-0
lines changed

9 files changed

+97
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"GST" : [ {
3+
"a" : "TestA1"
4+
}, {
5+
"a" : "TestB1",
6+
"b" : "TestB2"
7+
}, {
8+
"a" : "TestC1",
9+
"b" : "TestC2",
10+
"c" : "TestC3"
11+
} ],
12+
"subject" : [ {
13+
"name" : "Test",
14+
"altLabel" : [ "TestA1", "TestB1 ( TestB2 )", "TestC1 ( TestC2 TestC3 )" ]
15+
} ]
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"GST" : [
3+
{
4+
"a" : "TestA1"
5+
}, {
6+
"a" : "TestB1",
7+
"b" : "TestB2"
8+
}, {
9+
"a" : "TestC1",
10+
"b" : "TestC2",
11+
"c" : "TestC3"
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set_array("subject[]")
2+
add_field("subject[].$append.name","Test")
3+
set_array("subject[].$last.altLabel[]")
4+
5+
do list(path:"GST[]", "var": "$i") # Other altLabels have a "," character between $a and $b.
6+
paste("subject[].$last.altLabel[].$append", "$i.a", "~(", "$i.b", "$i.c", "~)")
7+
end
8+
9+
replace_all("subject[].*.altLabel[].*"," | \\( \\)","")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.json"
2+
|open-file
3+
|as-records
4+
|decode-json
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json(prettyPrinting="true")
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"GST" : [ {
3+
"a" : "TestA1"
4+
}, {
5+
"a" : "TestB1",
6+
"b" : "TestB2"
7+
}, {
8+
"a" : "TestC1",
9+
"b" : "TestC2",
10+
"c" : "TestC3"
11+
} ],
12+
"subject" : [ {
13+
"name" : "Test",
14+
"agent" : {
15+
"altLabel" : [ "TestA1", "TestB1 ( TestB2 )", "TestC1 ( TestC2 TestC3 )" ]
16+
}
17+
} ]
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"GST" : [
3+
{
4+
"a" : "TestA1"
5+
}, {
6+
"a" : "TestB1",
7+
"b" : "TestB2"
8+
}, {
9+
"a" : "TestC1",
10+
"b" : "TestC2",
11+
"c" : "TestC3"
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set_array("subject[]")
2+
add_field("subject[].$append.name","Test")
3+
set_array("subject[].$last.agent.altLabel[]")
4+
5+
do list(path:"GST[]", "var": "$i") # Other altLabels have a "," character between $a and $b.
6+
paste("subject[].$last.agent.altLabel[].$append", "$i.a", "~(", "$i.b", "$i.c", "~)")
7+
end
8+
9+
replace_all("subject[].*.agent.altLabel[].*"," | \\( \\)","")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.json"
2+
|open-file
3+
|as-records
4+
|decode-json
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json(prettyPrinting="true")
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See issue #278

0 commit comments

Comments
 (0)