freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [10/14] incubator-freemarker git commit: (Added a date format test for a markup producing format.)
Date Sun, 04 Oct 2015 14:49:35 GMT
(Added a date format test for a markup producing format.)


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

Branch: refs/heads/master
Commit: dd54594617cd382b60c6113649c7717b20cd54b8
Parents: db94e07
Author: ddekany <ddekany@apache.org>
Authored: Sun Oct 4 16:31:21 2015 +0200
Committer: ddekany <ddekany@apache.org>
Committed: Sun Oct 4 16:31:21 2015 +0200

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


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/dd545946/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 b36a97f..6902b95 100644
--- a/src/test/java/freemarker/core/DateFormatTest.java
+++ b/src/test/java/freemarker/core/DateFormatTest.java
@@ -62,7 +62,8 @@ public class DateFormatTest extends TemplateTest {
                 "epoch", EpochMillisTemplateDateFormatFactory.INSTANCE,
                 "loc", LocAndTZSensitiveTemplateDateFormatFactory.INSTANCE,
                 "div", EpochMillisDivTemplateDateFormatFactory.INSTANCE,
-                "appMeta", AppMetaTemplateDateFormatFactory.INSTANCE));
+                "appMeta", AppMetaTemplateDateFormatFactory.INSTANCE,
+                "htmlIso", HTMLISOTemplateDateFormatFactory.INSTANCE));
     }
 
     @Test
@@ -77,6 +78,14 @@ public class DateFormatTest extends TemplateTest {
                 "<#assign d = d?datetime>"
                 + "${d} ${d?string} <#setting locale='de_DE'>${d}",
                 "123456789 123456789 123456789");
+        
+        getConfiguration().setDateTimeFormat("@htmlIso");
+        assertOutput(
+                "<#assign d = d?datetime>"
+                + "${d} ${d?string} <#setting locale='de_DE'>${d}",
+                "1970-01-02<span class='T'>T</span>10:17:36Z "
+                + "1970-01-02T10:17:36Z "
+                + "1970-01-02<span class='T'>T</span>10:17:36Z");
     }
 
     @Test


Mime
View raw message