Skip to content
This repository has been archived by the owner on Jan 27, 2025. It is now read-only.

Commit

Permalink
Add unit test for copy_field with array and $append. (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwinter committed Feb 14, 2022
1 parent ffa65cb commit 46ced0b
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,39 @@ public void appendWithAsteriksWildcardAtTheEnd() {
);
}

@Test
// See https://github.com/metafacture/metafacture-fix/pull/142
public void shouldCopyArrayFieldWithoutAsterisk() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"set_array('TEST_TWO[]')",
"copy_field('test[]', 'TEST_TWO[].$append')"
),
i -> {
i.startRecord("1");
i.startEntity("test[]");
i.literal("1", "One");
i.literal("2", "Two");
i.literal("3", "Three");
i.endEntity();
i.endRecord();
},
o -> {
o.get().startRecord("1");
o.get().startEntity("test[]");
o.get().literal("1", "One");
o.get().literal("2", "Two");
o.get().literal("3", "Three");
o.get().endEntity();
o.get().startEntity("TEST_TWO[]");
o.get().literal("1", "One");
o.get().literal("2", "Two");
o.get().literal("3", "Three");
o.get().endEntity();
o.get().endRecord();
}
);
}

@Test
// See https://github.com/metafacture/metafacture-fix/issues/121
public void shouldCopyArrayFieldWithAsterisk() {
Expand Down

0 comments on commit 46ced0b

Please sign in to comment.