Skip to content

Commit 39c1bca

Browse files
committed
Add failing unit test for * wildcard usage on nested arrays
See https://gitlab.com/oersi/oersi-etl/-/merge_requests/175
1 parent 1f9d5c2 commit 39c1bca

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,35 @@ public void shouldDowncaseStringsInArray() {
120120
);
121121
}
122122

123+
@Test
124+
@MetafixToDo("NumberFormatException: For input string: '*'")
125+
public void shouldFilterArrayWithAsteriskAtEnd() {
126+
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
127+
"filter('title[].*', 'faust')"
128+
),
129+
i -> {
130+
i.startRecord("1");
131+
i.startEntity("title[]");
132+
i.startEntity("1[]");
133+
i.literal("1", "faust");
134+
i.endEntity();
135+
i.startEntity("2[]");
136+
i.literal("1", "räuber");
137+
i.endEntity();
138+
i.endEntity();
139+
i.endRecord();
140+
},
141+
(o, f) -> {
142+
o.get().startRecord("1");
143+
o.get().startEntity("title[]");
144+
o.get().startEntity("1[]");
145+
o.get().literal("1", "faust");
146+
f.apply(2).endEntity();
147+
o.get().endRecord();
148+
}
149+
);
150+
}
151+
123152
@Test
124153
public void shouldCapitalizeString() {
125154
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(

0 commit comments

Comments
 (0)