Update of /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template
In directory sc8-pr-cvs1:/tmp/cvs-serv21898/test/unit/org/webmacro/template
Modified Files:
TestCountDirective.java
Log Message:
Made #count work out whether an implicit step -1 can be used.
Index: TestCountDirective.java
===================================================================
RCS file: /cvsroot/webmacro/webmacro/test/unit/org/webmacro/template/TestCountDirective.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TestCountDirective.java 12 Jun 2003 00:47:49 -0000 1.4
--- TestCountDirective.java 29 Jul 2003 17:33:45 -0000 1.5
***************
*** 59,62 ****
--- 59,72 ----
+ public void testCountBackwardsImplicitStep () throws Exception
+ {
+ executeStringTemplate("#count $i from 10 to 1 { $Counter.next() }");
+ Integer i = (Integer) _context.get("i");
+ Counter c = (Counter) _context.get("Counter");
+ assertTrue(c.toString(), c.getCount() == 10);
+ assertTrue(i.toString(), i.intValue() == 1);
+ }
+
+
public void testCountBackwards () throws Exception
{
|