@@ -29,7 +29,7 @@ public FixParsingTest() {
29
29
@ Test
30
30
public void shouldParseSimple () throws Exception {
31
31
parse (
32
- "map (a,b)"
32
+ "copy_field (a,b)"
33
33
);
34
34
}
35
35
@@ -41,7 +41,9 @@ public void shouldParseQuotedStrings() throws Exception {
41
41
"add_field(hello,\" w-o:r l/d\" )" ,
42
42
"add_field(hello,'\t w\n \t orld')" ,
43
43
"add_field(hello,'\\ tw\\ n\\ torld')" ,
44
- "add_field(hello,'\" world\" ')"
44
+ "add_field(hello,'\" world\" ')" ,
45
+ "add_field(\" hello\" ,world)" ,
46
+ "add_field('hello','world')"
45
47
);
46
48
}
47
49
@@ -50,17 +52,17 @@ public void shouldParseMappings() throws Exception {
50
52
parse (
51
53
"# simple field name mappings" ,
52
54
"" ,
53
- "map (a,b)" ,
55
+ "copy_field (a,b)" ,
54
56
"" ,
55
57
"# nested field structure" ,
56
58
"" ,
57
- "map (e1)" ,
58
- "map (e1.e2)" ,
59
- "map (e1.e2.d)" ,
59
+ "copy_field (e1,f1 )" ,
60
+ "copy_field (e1.e2,f1 )" ,
61
+ "copy_field (e1.e2.d,f1 )" ,
60
62
"" ,
61
- "# pass-through for unmapped fields" ,
63
+ "# pass-through for fields by default, use retain to only keep certain elements " ,
62
64
"" ,
63
- "map(_else )" ,
65
+ "retain(f1, b )" ,
64
66
""
65
67
);
66
68
}
@@ -90,15 +92,15 @@ public void shouldParseTransformations() throws Exception {
90
92
"" ,
91
93
"# Loops" ,
92
94
"" ,
93
- "do list(path)" ,
95
+ "do list(path:'test' )" ,
94
96
"\t add_field(foo,bar)" ,
95
97
LITERAL_END ,
96
98
"" ,
97
99
"# Nested expressions" ,
98
100
"" ,
99
- "do marc_each( )" ,
100
- "\t if marc_has(f700 )" ,
101
- "\t \t marc_map(f700a, authors.$append)" ,
101
+ "do list(path:'700??','var':'$i' )" ,
102
+ "\t if any_match('$i.4','aut' )" ,
103
+ "\t \t copy_field('$i.a',' authors.$append' )" ,
102
104
"\t " + LITERAL_END ,
103
105
LITERAL_END ,
104
106
""
0 commit comments