tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r896571 - /tomcat/trunk/test/org/apache/el/TestELEvaluation.java
Date Wed, 06 Jan 2010 17:41:12 GMT
Author: markt
Date: Wed Jan  6 17:41:11 2010
New Revision: 896571

URL: http://svn.apache.org/viewvc?rev=896571&view=rev
Log:
Additional tests for the specific escaping (of "${" and "#{") for LiteralExpressions

Modified:
    tomcat/trunk/test/org/apache/el/TestELEvaluation.java

Modified: tomcat/trunk/test/org/apache/el/TestELEvaluation.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/el/TestELEvaluation.java?rev=896571&r1=896570&r2=896571&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/el/TestELEvaluation.java (original)
+++ tomcat/trunk/test/org/apache/el/TestELEvaluation.java Wed Jan  6 17:41:11 2010
@@ -52,6 +52,22 @@
 
         // '\' is only an escape character inside a StringLiteral
         assertEquals("\\\\", evaluateExpression("\\\\"));
+        
+        /*
+         * LiteralExpresions can only contain ${ or #{ if escaped with \
+         * \ is not an escape character in any other circumstances including \\
+         */
+        assertEquals("\\", evaluateExpression("\\"));
+        assertEquals("$", evaluateExpression("$"));
+        assertEquals("#", evaluateExpression("#"));
+        assertEquals("\\$", evaluateExpression("\\$"));
+        assertEquals("\\#", evaluateExpression("\\#"));
+        assertEquals("\\\\$", evaluateExpression("\\\\$"));
+        assertEquals("\\\\#", evaluateExpression("\\\\#"));
+        assertEquals("${", evaluateExpression("\\${"));
+        assertEquals("#{", evaluateExpression("\\#{"));
+        assertEquals("\\${", evaluateExpression("\\\\${"));
+        assertEquals("\\#{", evaluateExpression("\\\\#{"));
     }
 
     public void testParserStringLiteral() {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message