This is an automated email from the ASF dual-hosted git repository. henrib pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-jexl.git
The following commit(s) were added to refs/heads/master by this push: new 27910a2 JEXL-328: updated test Task #JEXL-328 - JXLT template scripts evaluation do not process pragmas new 5c0a1c5 Merge branch 'master' of https://gitbox.apache.org/repos/asf/commons-jexl 27910a2 is described below commit 27910a286c11313e62a71454dc6801b5e8fc712f Author: henrib <hen...@apache.org> AuthorDate: Wed Apr 8 09:53:42 2020 +0200 JEXL-328: updated test Task #JEXL-328 - JXLT template scripts evaluation do not process pragmas --- src/test/java/org/apache/commons/jexl3/JXLTTest.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/apache/commons/jexl3/JXLTTest.java b/src/test/java/org/apache/commons/jexl3/JXLTTest.java index 9f91d3c..811fa63 100644 --- a/src/test/java/org/apache/commons/jexl3/JXLTTest.java +++ b/src/test/java/org/apache/commons/jexl3/JXLTTest.java @@ -29,6 +29,7 @@ import java.io.Writer; import java.util.Arrays; import java.util.List; import java.util.Set; +import org.apache.commons.jexl3.internal.Engine; import org.junit.After; import org.junit.Assert; @@ -54,6 +55,7 @@ public class JXLTTest extends JexlTestCase { ENGINE = jexl; JXLT = ENGINE.createJxltEngine(); } + @Parameterized.Parameters public static List<JexlEngine> engines() { @@ -1034,6 +1036,7 @@ public class JXLTTest extends JexlTestCase { return options; } } + @Test public void testLexicalTemplate() throws Exception { JexlOptions opts = new JexlOptions(); @@ -1055,12 +1058,7 @@ public class JXLTTest extends JexlTestCase { String output0 = strw0.toString(); Assert.assertEquals( "-strict -cancellable -lexical -lexicalShade +safe", output0); - String src = "$$ #pragma script.mode pro50\n" - + "${$options.strict?'+':'-'}strict" - + " ${$options.cancellable?'+':'-'}cancellable" - + " ${$options.lexical?'+':'-'}lexical" - + " ${$options.lexicalShade?'+':'-'}lexicalShade" - + " ${$options.safe?'+':'-'}safe"; + String src = "$$ #pragma script.mode pro50\n" + src0; JxltEngine.Template tmplt = JXLT.createTemplate("$$", new StringReader(src)); Writer strw = new StringWriter();