Return-Path: X-Original-To: apmail-freemarker-notifications-archive@minotaur.apache.org Delivered-To: apmail-freemarker-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 867E718D4D for ; Sun, 4 Oct 2015 14:45:01 +0000 (UTC) Received: (qmail 79519 invoked by uid 500); 4 Oct 2015 14:45:01 -0000 Delivered-To: apmail-freemarker-notifications-archive@freemarker.apache.org Received: (qmail 79503 invoked by uid 500); 4 Oct 2015 14:45:01 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 79493 invoked by uid 99); 4 Oct 2015 14:45:01 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2015 14:45:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EA457180992 for ; Sun, 4 Oct 2015 14:45:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.774 X-Spam-Level: * X-Spam-Status: No, score=1.774 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.006] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 7KaQIBlYZ_hA for ; Sun, 4 Oct 2015 14:45:00 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 2984C20633 for ; Sun, 4 Oct 2015 14:45:00 +0000 (UTC) Received: (qmail 79424 invoked by uid 99); 4 Oct 2015 14:45:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Oct 2015 14:45:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 935D1DFAEC; Sun, 4 Oct 2015 14:44:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ddekany@apache.org To: notifications@freemarker.incubator.apache.org Date: Sun, 04 Oct 2015 14:45:00 -0000 Message-Id: <078d697b3f5e4c4d8172305e74ea40c7@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] incubator-freemarker git commit: (Added unknown date-type test) (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 Authored: Sun Oct 4 16:44:42 2015 +0200 Committer: ddekany 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;