Skip to content

Commit d20530e

Browse files
committed
Add MetafixToDo test for adding with $last in implicit array (#369)
1 parent 49cfaca commit d20530e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,42 @@ public void addWithPrependInImplicitArray() {
393393
);
394394
}
395395

396+
@Test
397+
@MetafixToDo("See https://github.com/metafacture/metafacture-fix/issues/369")
398+
public void addWithLastInImplicitArray() {
399+
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
400+
"add_field('my.name.$last','patrick')",
401+
"add_field('my.name.$last','nicolas')"
402+
),
403+
i -> {
404+
i.startRecord("1");
405+
i.endRecord();
406+
407+
i.startRecord("2");
408+
i.startEntity("my");
409+
i.literal("name", "max");
410+
i.endEntity();
411+
i.endRecord();
412+
413+
i.startRecord("3");
414+
i.endRecord();
415+
},
416+
o -> {
417+
o.get().startRecord("1");
418+
o.get().endRecord();
419+
420+
o.get().startRecord("2");
421+
o.get().startEntity("my");
422+
o.get().literal("name", "nicolas");
423+
o.get().endEntity();
424+
o.get().endRecord();
425+
426+
o.get().startRecord("3");
427+
o.get().endRecord();
428+
}
429+
);
430+
}
431+
396432
@Test
397433
public void addWithAppendInArray() {
398434
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(

0 commit comments

Comments
 (0)