You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by ge...@locus.apache.org on 2000/12/08 04:20:06 UTC

cvs commit: jakarta-velocity/test/templates/compare arithmetic.cmp comment.cmp pedantic.cmp

geirm       00/12/07 19:20:05

  Modified:    test/templates arithmetic.vm comment.vm pedantic.vm
               test/templates/compare arithmetic.cmp comment.cmp
                        pedantic.cmp
  Log:
  Added tests for inline set #set( expr )
  
  Revision  Changes    Path
  1.3       +15 -0     jakarta-velocity/test/templates/arithmetic.vm
  
  Index: arithmetic.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/arithmetic.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- arithmetic.vm	2000/10/23 21:18:27	1.2
  +++ arithmetic.vm	2000/12/08 03:20:03	1.3
  @@ -21,3 +21,18 @@
   
   #set $foo = $foo / 2
   $foo
  +
  +And the whole thing again with inline set statements
  +
  +#set( $foo = 5)
  +#set( $foo = $foo + 1)
  +$foo
  +
  +#set ( $foo = $foo - 1 )
  +$foo
  +
  +#set( $foo = $foo * 2)
  +$foo
  +
  +#set ($foo = $foo / 2)
  +$foo
  
  
  
  1.4       +5 -0      jakarta-velocity/test/templates/comment.vm
  
  Index: comment.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/comment.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- comment.vm	2000/11/16 20:29:38	1.3
  +++ comment.vm	2000/12/08 03:20:03	1.4
  @@ -30,3 +30,8 @@
   The following is a 'Christoph Comment' ;)
   ##  ##
   foo
  +
  +We can now comment after the inline set :
  +
  +#set( $foo = 1 ) ## and this is a set statement
  +
  
  
  
  1.5       +6 -0      jakarta-velocity/test/templates/pedantic.vm
  
  Index: pedantic.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/pedantic.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- pedantic.vm	2000/11/05 19:21:13	1.4
  +++ pedantic.vm	2000/12/08 03:20:03	1.5
  @@ -93,3 +93,9 @@
     	System.out.println("$b"); 
   	#end
   	}
  +
  +Inline set statement :
  +
  +Here are the prices :#set( $arr = ["$10.24","$15.32","$12.15"] ) #foreach($a in $arr) $a #end
  +
  +
  
  
  
  1.5       +10 -0     jakarta-velocity/test/templates/compare/arithmetic.cmp
  
  Index: arithmetic.cmp
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/compare/arithmetic.cmp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- arithmetic.cmp	2000/10/31 16:07:27	1.4
  +++ arithmetic.cmp	2000/12/08 03:20:04	1.5
  @@ -7,3 +7,13 @@
   10
   
   5
  +
  +And the whole thing again with inline set statements
  +
  +6
  +
  +5
  +
  +10
  +
  +5
  
  
  
  1.3       +4 -0      jakarta-velocity/test/templates/compare/comment.cmp
  
  Index: comment.cmp
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/compare/comment.cmp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- comment.cmp	2000/11/16 20:29:38	1.2
  +++ comment.cmp	2000/12/08 03:20:04	1.3
  @@ -9,3 +9,7 @@
   
   The following is a 'Christoph Comment' ;)
   foo
  +
  +We can now comment after the inline set :
  +
  + 
  
  
  
  1.3       +5 -0      jakarta-velocity/test/templates/compare/pedantic.cmp
  
  Index: pedantic.cmp
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity/test/templates/compare/pedantic.cmp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- pedantic.cmp	2000/11/05 19:21:14	1.2
  +++ pedantic.cmp	2000/12/08 03:20:05	1.3
  @@ -72,3 +72,8 @@
   	  	System.out.println("first element"); 
   	  	System.out.println("second element"); 
   		}
  +
  +Inline set statement :
  +
  +Here are the prices :  $10.24  $15.32  $12.15 
  +