Skip to content

Commit 3a0e0aa

Browse files
committed
Only use current fix examples for tests #633
1 parent 84c958a commit 3a0e0aa

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

metafix/src/test/java/org/metafacture/metafix/FixParsingTest.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public FixParsingTest() {
2929
@Test
3030
public void shouldParseSimple() throws Exception {
3131
parse(
32-
"map(a,b)"
32+
"copy_field(a,b)"
3333
);
3434
}
3535

@@ -41,7 +41,9 @@ public void shouldParseQuotedStrings() throws Exception {
4141
"add_field(hello,\"w-o:r l/d\")",
4242
"add_field(hello,'\tw\n\torld')",
4343
"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')"
4547
);
4648
}
4749

@@ -50,17 +52,17 @@ public void shouldParseMappings() throws Exception {
5052
parse(
5153
"# simple field name mappings",
5254
"",
53-
"map(a,b)",
55+
"copy_field(a,b)",
5456
"",
5557
"# nested field structure",
5658
"",
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)",
6062
"",
61-
"# pass-through for unmapped fields",
63+
"# pass-through for fields by default, use retain to only keep certain elements",
6264
"",
63-
"map(_else)",
65+
"retain(f1, b)",
6466
""
6567
);
6668
}
@@ -90,15 +92,15 @@ public void shouldParseTransformations() throws Exception {
9092
"",
9193
"# Loops",
9294
"",
93-
"do list(path)",
95+
"do list(path:'test')",
9496
"\tadd_field(foo,bar)",
9597
LITERAL_END,
9698
"",
9799
"# Nested expressions",
98100
"",
99-
"do marc_each()",
100-
"\tif marc_has(f700)",
101-
"\t\tmarc_map(f700a,authors.$append)",
101+
"do list(path:'700??','var':'$i')",
102+
"\tif any_match('$i.4','aut')",
103+
"\t\tcopy_field('$i.a','authors.$append')",
102104
"\t" + LITERAL_END,
103105
LITERAL_END,
104106
""

0 commit comments

Comments
 (0)