freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [1/2] incubator-freemarker git commit: Some more markup string literal interpolation tests
Date Sun, 04 Oct 2015 12:15:53 GMT
Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae 75fab1f78 -> db94e0726


Some more markup string literal interpolation tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/83a30d5a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/83a30d5a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/83a30d5a

Branch: refs/heads/2.3-gae
Commit: 83a30d5ae03b76ef637cda926ed13009e8fc0294
Parents: 75fab1f
Author: ddekany <ddekany@apache.org>
Authored: Sun Oct 4 13:58:20 2015 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sun Oct 4 13:58:20 2015 +0200

----------------------------------------------------------------------
 .../core/StringLiteralInterpolationTest.java           | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/83a30d5a/src/test/java/freemarker/core/StringLiteralInterpolationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/core/StringLiteralInterpolationTest.java b/src/test/java/freemarker/core/StringLiteralInterpolationTest.java
index b7bfeee..fc66013 100644
--- a/src/test/java/freemarker/core/StringLiteralInterpolationTest.java
+++ b/src/test/java/freemarker/core/StringLiteralInterpolationTest.java
@@ -111,6 +111,19 @@ public class StringLiteralInterpolationTest extends TemplateTest {
         assertOutput("${\"${1000}, ${2000}\"}", "1.00*10<sup>3</sup>, 2.00*10<sup>3</sup>");
         assertOutput("${\"& ${'x'}, ${2000}\"}", "&amp; x, 2.00*10<sup>3</sup>");
         assertOutput("${\"& ${'x'}, #{2000}\"}", "& x, 2000");
+        
+        assertOutput("${\"${2000}\"?isMarkupOutput?c}", "true");
+        assertOutput("${\"x ${2000}\"?isMarkupOutput?c}", "true");
+        assertOutput("${\"${2000} x\"?isMarkupOutput?c}", "true");
+        assertOutput("${\"#{2000}\"?isMarkupOutput?c}", "false");
+        assertOutput("${\"${'x'}\"?isMarkupOutput?c}", "false");
+        assertOutput("${\"x ${'x'}\"?isMarkupOutput?c}", "false");
+        assertOutput("${\"${'x'} x\"?isMarkupOutput?c}", "false");
+        
+        addToDataModel("rtf", RTFOutputFormat.INSTANCE.fromMarkup("\\p"));
+        assertOutput("${\"${rtf}\"?isMarkupOutput?c}", "true");
+        assertErrorContains("${\"${1000}${rtf}\"}", TemplateException.class, "HTML", "RTF",
"onversion");
+        assertErrorContains("x${\"${1000}${rtf}\"}", TemplateException.class, "HTML", "RTF",
"onversion");
     }
     
 }


Mime
View raw message