Skip to content

Commit 899976c

Browse files
committed
Add test for is_contained_in() Fix conditional. (#235)
1 parent 56f61b9 commit 899976c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,35 @@ public void shouldContainStringInString() {
11641164
);
11651165
}
11661166

1167+
@Test
1168+
public void shouldContainStringInStringAlias() {
1169+
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
1170+
"if is_contained_in(foo,bar)",
1171+
" add_field(forty_two,ok)",
1172+
"end"
1173+
),
1174+
i -> {
1175+
i.startRecord("1");
1176+
i.literal("foo", "42");
1177+
i.literal("bar", "42");
1178+
i.endRecord();
1179+
i.startRecord("2");
1180+
i.literal("foo", "42");
1181+
i.endRecord();
1182+
},
1183+
o -> {
1184+
o.get().startRecord("1");
1185+
o.get().literal("foo", "42");
1186+
o.get().literal("bar", "42");
1187+
o.get().literal("forty_two", "ok");
1188+
o.get().endRecord();
1189+
o.get().startRecord("2");
1190+
o.get().literal("foo", "42");
1191+
o.get().endRecord();
1192+
}
1193+
);
1194+
}
1195+
11671196
@Test
11681197
public void shouldContainStringInArray() {
11691198
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(

0 commit comments

Comments
 (0)