You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2015/12/17 21:35:51 UTC

[1/2] incubator-freemarker git commit: (Added an AST test case)

Repository: incubator-freemarker
Updated Branches:
  refs/heads/2.3-gae 204723f09 -> 4af2c81d9


(Added an AST test case)


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

Branch: refs/heads/2.3-gae
Commit: d1dafa5427b1caec463ca3f62cc89c416ae2a478
Parents: 204723f
Author: ddekany <dd...@apache.org>
Authored: Thu Dec 17 21:06:18 2015 +0100
Committer: ddekany <dd...@apache.org>
Committed: Thu Dec 17 21:06:18 2015 +0100

----------------------------------------------------------------------
 src/test/java/freemarker/core/ASTTest.java                       | 4 ++++
 src/test/resources/freemarker/core/ast-nestedignoredchildren.ast | 2 ++
 src/test/resources/freemarker/core/ast-nestedignoredchildren.ftl | 1 +
 3 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d1dafa54/src/test/java/freemarker/core/ASTTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/core/ASTTest.java b/src/test/java/freemarker/core/ASTTest.java
index a700334..1981ba6 100644
--- a/src/test/java/freemarker/core/ASTTest.java
+++ b/src/test/java/freemarker/core/ASTTest.java
@@ -63,6 +63,10 @@ public class ASTTest extends FileTestCase {
         testAST("ast-multipleignoredchildren");
     }
     
+    public void testNestedIgnoredChildren() throws Exception {
+        testAST("ast-nestedignoredchildren");
+    }
+
     private void testAST(String testName) throws FileNotFoundException, IOException {
         final String templateName = testName + ".ftl";
         assertExpectedFileEqualsString(

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d1dafa54/src/test/resources/freemarker/core/ast-nestedignoredchildren.ast
----------------------------------------------------------------------
diff --git a/src/test/resources/freemarker/core/ast-nestedignoredchildren.ast b/src/test/resources/freemarker/core/ast-nestedignoredchildren.ast
new file mode 100644
index 0000000..5a43456
--- /dev/null
+++ b/src/test/resources/freemarker/core/ast-nestedignoredchildren.ast
@@ -0,0 +1,2 @@
+#outputformat  // f.c.OutputFormatBlock
+    - value: "HTML"  // f.c.StringLiteral

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/d1dafa54/src/test/resources/freemarker/core/ast-nestedignoredchildren.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/freemarker/core/ast-nestedignoredchildren.ftl b/src/test/resources/freemarker/core/ast-nestedignoredchildren.ftl
new file mode 100644
index 0000000..2f6043a
--- /dev/null
+++ b/src/test/resources/freemarker/core/ast-nestedignoredchildren.ftl
@@ -0,0 +1 @@
+<#outputFormat 'HTML'><#outputFormat 'HTML'><#outputFormat 'HTML'></#outputFormat></#outputFormat></#outputFormat>
\ No newline at end of file


[2/2] incubator-freemarker git commit: (Test case to test #return in macros)

Posted by dd...@apache.org.
(Test case to test #return in macros)


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

Branch: refs/heads/2.3-gae
Commit: 4af2c81d9bba53fb8a6ad6b0a810bebb386871ba
Parents: d1dafa5
Author: ddekany <dd...@apache.org>
Authored: Thu Dec 17 21:32:48 2015 +0100
Committer: ddekany <dd...@apache.org>
Committed: Thu Dec 17 21:34:09 2015 +0100

----------------------------------------------------------------------
 .../test/templatesuite/expected/macros-return.txt   |  5 +++++
 .../test/templatesuite/templates/macros-return.ftl  | 16 ++++++++++++++++
 .../freemarker/test/templatesuite/testcases.xml     |  1 +
 3 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4af2c81d/src/test/resources/freemarker/test/templatesuite/expected/macros-return.txt
----------------------------------------------------------------------
diff --git a/src/test/resources/freemarker/test/templatesuite/expected/macros-return.txt b/src/test/resources/freemarker/test/templatesuite/expected/macros-return.txt
new file mode 100644
index 0000000..c7f0329
--- /dev/null
+++ b/src/test/resources/freemarker/test/templatesuite/expected/macros-return.txt
@@ -0,0 +1,5 @@
+m{
+m{
+m{
+b{
+m:b{
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4af2c81d/src/test/resources/freemarker/test/templatesuite/templates/macros-return.ftl
----------------------------------------------------------------------
diff --git a/src/test/resources/freemarker/test/templatesuite/templates/macros-return.ftl b/src/test/resources/freemarker/test/templatesuite/templates/macros-return.ftl
new file mode 100644
index 0000000..d71bbd6
--- /dev/null
+++ b/src/test/resources/freemarker/test/templatesuite/templates/macros-return.ftl
@@ -0,0 +1,16 @@
+<#macro m>m{<#return>}</#macro>
+<@m/>
+
+<#macro m><#if true>m{<#return>}</#if></#macro>
+<@m/>
+
+<#macro m><#if true>m{<#return></#if>}</#macro>
+<@m/>
+
+<#macro b>b{<#nested>}</#macro>
+<#macro m><@b><#return></@></#macro>
+<@m/>
+
+<#macro b>b{<#nested>}</#macro>
+<#macro m>m:<@b><#return></@></#macro>
+<@m/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4af2c81d/src/test/resources/freemarker/test/templatesuite/testcases.xml
----------------------------------------------------------------------
diff --git a/src/test/resources/freemarker/test/templatesuite/testcases.xml b/src/test/resources/freemarker/test/templatesuite/testcases.xml
index 4fbb6dd..31d6606 100644
--- a/src/test/resources/freemarker/test/templatesuite/testcases.xml
+++ b/src/test/resources/freemarker/test/templatesuite/testcases.xml
@@ -122,6 +122,7 @@
    <testCase name="loopvariable" />
    <testCase name="macros"/>
    <testCase name="macros2"/>
+   <testCase name="macros-return"/>
    <testCase name="multimodels"/>
    <testCase name="nested" />
    <testCase name="newlines1" />