Skip to content

Commit

Permalink
Add test for to_var #282
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 23, 2024
1 parent 5561729 commit b8f2987
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4084,4 +4084,39 @@ public void shouldTransformStringToBase64() {
);
}

@Test
public void shouldTransformStringToBase64() {
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
"to_var('data.title','testVar')",
"add_field('testResult','This is a $[testVar]')"
),
i -> {
i.startRecord("1");
i.startEntity("data");
i.literal("title", "test");
i.endEntity();
i.endRecord();
i.startRecord("2");
i.startEntity("data");
i.literal("title", "another-test");
i.endEntity();
i.endRecord();
},
o -> {
o.get().startRecord("1");
o.get().startEntity("data");
o.get().literal("title", "test");
o.get().literal("title", "This is a test");
o.get().endEntity();
o.get().endRecord();
o.get().startRecord("2");
o.get().startEntity("data");
o.get().literal("title", "second-test");
o.get().literal("title", "This is a second-test");
o.get().endEntity();
o.get().endRecord();
}
);
}

}

0 comments on commit b8f2987

Please sign in to comment.