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 24ca1318 JEXL: improve string containing backslashed-characters test 24ca1318 is described below commit 24ca13182292441f4f2bb57b2dfd2bc80631dbc4 Author: henrib <hen...@apache.org> AuthorDate: Mon Aug 29 18:47:38 2022 +0200 JEXL: improve string containing backslashed-characters test --- .../java/org/apache/commons/jexl3/Issues300Test.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/apache/commons/jexl3/Issues300Test.java b/src/test/java/org/apache/commons/jexl3/Issues300Test.java index 34ef2af1..9357f5da 100644 --- a/src/test/java/org/apache/commons/jexl3/Issues300Test.java +++ b/src/test/java/org/apache/commons/jexl3/Issues300Test.java @@ -22,10 +22,8 @@ import org.apache.commons.jexl3.introspection.JexlSandbox; import org.junit.Assert; import org.junit.Test; -import java.io.File; import java.io.StringReader; import java.io.StringWriter; -import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -915,11 +913,20 @@ public class Issues300Test { } @Test - public void testBackslashTee() throws Exception { + public void testBackslashes() throws Exception { JexlEngine jexl = new JexlBuilder().safe(false).create(); - String src = "\"}.</br>Cela inclut :</br>-\tQu?il n?y a plus de questions en cours</br>-\""; - final JexlScript s = jexl.createScript(src); + String src = "\"\b\t\f\""; + JexlScript s = jexl.createScript(src); Assert.assertNotNull(s); + String ctl = "\b\t\f"; + Assert.assertEquals(ctl, s.execute(null)); + String parsed = s.getParsedText(); + Assert.assertEquals("'\\b\\t\\f'", parsed); + s = jexl.createScript(src); + Assert.assertNotNull(s); + Assert.assertEquals(ctl, s.execute(null)); + parsed = s.getParsedText(); + Assert.assertEquals("'\\b\\t\\f'", parsed); } }