velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r708677 - /velocity/engine/trunk/src/test/org/apache/velocity/test/DefineTestCase.java
Date Tue, 28 Oct 2008 21:31:42 GMT
Author: nbubna
Date: Tue Oct 28 14:31:41 2008
New Revision: 708677

URL: http://svn.apache.org/viewvc?rev=708677&view=rev
Log:
VELOCITY-174 add test to be sure non-rendering use works

Modified:
    velocity/engine/trunk/src/test/org/apache/velocity/test/DefineTestCase.java

Modified: velocity/engine/trunk/src/test/org/apache/velocity/test/DefineTestCase.java
URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/DefineTestCase.java?rev=708677&r1=708676&r2=708677&view=diff
==============================================================================
--- velocity/engine/trunk/src/test/org/apache/velocity/test/DefineTestCase.java (original)
+++ velocity/engine/trunk/src/test/org/apache/velocity/test/DefineTestCase.java Tue Oct 28
14:31:41 2008
@@ -76,6 +76,17 @@
         assertEvalEquals("[][hello]","#define( $orig )hello#end[#set( $assig = $orig )][$assig]");
     }
 
+    public void testNonRenderingUsage()
+    {
+        String template = "#define($foo)\n" +
+                          " foo_contents\n" +
+                          "#end\n" +
+                          "#if ($foo)\n" +
+                          " found foo\n" +
+                          "#end";
+        assertEvalEquals(" found foo\n", template);
+    }
+
     public void testRecursionLimit()
     {
         try



Mime
View raw message