freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [2/2] incubator-freemarker git commit: (Added unknown date-type test)
Date Sun, 04 Oct 2015 14:45:00 GMT
(Added unknown date-type test)


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

Branch: refs/heads/2.3-gae
Commit: 1e905a47da788a9e0d5fa5b820e6250bc0980c1a
Parents: 43007bf
Author: ddekany <ddekany@apache.org>
Authored: Sun Oct 4 16:44:42 2015 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sun Oct 4 16:44:42 2015 +0200

----------------------------------------------------------------------
 src/test/java/freemarker/core/DateFormatTest.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/1e905a47/src/test/java/freemarker/core/DateFormatTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/core/DateFormatTest.java b/src/test/java/freemarker/core/DateFormatTest.java
index 6902b95..20b2cc9 100644
--- a/src/test/java/freemarker/core/DateFormatTest.java
+++ b/src/test/java/freemarker/core/DateFormatTest.java
@@ -428,6 +428,14 @@ public class DateFormatTest extends TemplateTest {
                 T + " " + T + "/foo");
     }
     
+    @Test
+    public void testUnknownDateType() throws IOException, TemplateException {
+        addToDataModel("u", new Date(T));
+        assertErrorContains("${u?string}", "isn't known");
+        assertOutput("${u?string('yyyy')}", "2015");
+        assertOutput("<#assign s = u?string>${s('yyyy')}", "2015");
+    }
+    
     private static class MutableTemplateDateModel implements TemplateDateModel {
         
         private Date date;


Mime
View raw message