henrib commented on code in PR #397:
URL: https://github.com/apache/commons-jexl/pull/397#discussion_r2764001599
##########
src/test/java/org/apache/commons/jexl3/Issues400Test.java:
##########
@@ -798,6 +799,38 @@ void testIssue441() {
Assertions.assertEquals(ctl, o);
}
+ @Test
+ void testIssue455a() {
+ final JexlEngine jexl = new JexlBuilder().create();
+ String code = "name -> `${name +\n\t\b\f\r name}`";
+ JexlScript script = jexl.createScript(code);
+ Object o = script.execute(null, "Hello");
+ String ctl = "HelloHello";
+ Assertions.assertEquals(ctl, o);
+ }
+
+ @Test
+ void testIssue455b() {
+ final JexlEngine jexl = new JexlBuilder().create();
+ String code = "name -> `${name}\n${name}`;";
+ JexlScript script = jexl.createScript(code);
+ Object o = script.execute(null, "Hello");
+ String ctl = "Hello\nHello";
+ Assertions.assertEquals(ctl, o);
+ }
+
+ @Test
+ void testIssue455() {
+ final JexlEngine jexl = new JexlBuilder().create();
+ final JexlContext context = new MapContext();
+ context.set("name", "Hello");
+ final JxltEngine jxlt = jexl.createJxltEngine();
+ final JxltEngine.Template template =
jxlt.createTemplate("<b>\n\t${name\n\t+ name}\n</b>");
+ final StringWriter writer = new StringWriter();
+ template.evaluate(context, writer);
+ assertEquals("<b>\n\tHelloHello\n</b>", writer.toString());
+ }
Review Comment:
Same as above comment, the syntax is explicitly ${ or #{ , no ignorable
character in that sequence that behaves as a pair.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]