Test for a bug with processing of double quotes in AttributeParser#parseEL
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 4 Feb 2010 12:16:51 +0000 (12:16 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Thu, 4 Feb 2010 12:16:51 +0000 (12:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@906464 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/el/TestELInJsp.java
test/webapp/el-misc.jsp

index 5b84f00..3bb8c35 100644 (file)
@@ -322,6 +322,7 @@ public class TestELInJsp extends TomcatBaseTest {
         ByteChunk res = getUrl("http://localhost:" + getPort() +
                 "/test/el-misc.jsp");
         String result = res.toString();
+        System.out.println(result);
         assertEcho(result, "00-\\\\\\\"${'hello world'}");
         assertEcho(result, "01-\\\\\\\"\\${'hello world'}");
         assertEcho(result, "02-\\\"${'hello world'}");
@@ -334,6 +335,12 @@ public class TestELInJsp extends TomcatBaseTest {
         assertEcho(result, "09-az2");
         assertEcho(result, "10-${'foo'}bar");
         assertEcho(result, "11-\"}");
+        assertEcho(result, "12-foo\\bar\\baz");
+        assertEcho(result, "13-foo\\bar\\baz");
+        assertEcho(result, "14-foo\\bar\\baz");
+        assertEcho(result, "15-foo\\bar\\baz");
+        assertEcho(result, "16-foo\\bar\\baz");
+        assertEcho(result, "17-foo\\bar\\baz");
     }
 
     public void testScriptingExpression() throws Exception {
index 8e56e96..053252b 100644 (file)
     <tags:echo echo="09-az${\"2\"}" />
     <tags:echo echo="10-\${'foo'}${'bar'}" />
     <tags:echo echo="11-${\"\\\"}\"}" />
+    <tags:echo echo="12-${'foo'}\\${'bar'}\\${'baz'}" />
+    <tags:echo echo="13-${'foo'}\\${\"bar\"}\\${'baz'}" />
+    <tags:echo echo="14-${\"foo\"}\\${'bar'}\\${\"baz\"}" />
+    <tags:echo echo='15-${\'foo\'}\\${"bar"}\\${\'baz\'}' />
+    <tags:echo echo='16-${"foo"}\\${\'bar\'}\\${"baz"}' />
+    <tags:echo echo='17-${"foo"}\\${&apos;bar&apos;}\\${&quot;baz&quot;}' />
   </body>
 </html>
\ No newline at end of file