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/21 06:52:16 UTC
cvs commit: jakarta-velocity/test/templates/compare interpolation.cmp
geirm 00/12/20 21:52:16
Modified: test/templates interpolation.vm
test/templates/compare interpolation.cmp
Log:
Added tests for the single-quoted, non-interpolated string lits.
Revision Changes Path
1.2 +12 -0 jakarta-velocity/test/templates/interpolation.vm
Index: interpolation.vm
===================================================================
RCS file: /home/cvs/jakarta-velocity/test/templates/interpolation.vm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- interpolation.vm 2000/11/28 04:31:04 1.1
+++ interpolation.vm 2000/12/21 05:52:15 1.2
@@ -51,3 +51,15 @@
#set $code = "#if(false) True #else False #end"
$code
+
+Now, non interpolated stringlits :
+
+#set($a = "$code")
+#set($b = '$code')
+#set($c = '$!$\!code')
+
+$a
+$b
+$c
+
+-- end --
1.2 +9 -0 jakarta-velocity/test/templates/compare/interpolation.cmp
Index: interpolation.cmp
===================================================================
RCS file: /home/cvs/jakarta-velocity/test/templates/compare/interpolation.cmp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- interpolation.cmp 2000/11/28 04:31:27 1.1
+++ interpolation.cmp 2000/12/21 05:52:16 1.2
@@ -29,3 +29,12 @@
False
+
+Now, non interpolated stringlits :
+
+
+ False
+$code
+$!$\!code
+
+-- end --
Re: cvs commit: jakarta-velocity/test/templates/compareinterpolation.cmp
Posted by jeff <jl...@houseofdistraction.com>.
"Geir Magnusson Jr." wrote:
>
> Jon Stevens wrote:
> >
> > on 12/20/2000 9:52 PM, "geirm@locus.apache.org" <ge...@locus.apache.org>
> > wrote:
> >
> > > +
> > > +Now, non interpolated stringlits :
> > > +
> > > +
> > > + False
> >
> > I don't think that the space in front of the False should be there.
>
> It should be. It is the rendering of the interpolated string "$code".
> $code was set above, via
>
> #set $code = "#if(false) True #else False #end"
>
> and there is a space between '#else' and 'False'.
So is there any straight-forward way to not have spaces there? I can
only think of a clever way:
#set $code = "#if(false)True#elseif(!false)False#end"
Re: cvs commit: jakarta-velocity/test/templates/compareinterpolation.cmp
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Jon Stevens wrote:
>
> on 12/20/2000 9:52 PM, "geirm@locus.apache.org" <ge...@locus.apache.org>
> wrote:
>
> > +
> > +Now, non interpolated stringlits :
> > +
> > +
> > + False
>
> I don't think that the space in front of the False should be there.
It should be. It is the rendering of the interpolated string "$code".
$code was set above, via
#set $code = "#if(false) True #else False #end"
and there is a space between '#else' and 'False'.
geir
--
Geir Magnusson Jr. geirm@optonline.com
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity
Re: cvs commit: jakarta-velocity/test/templates/compare
interpolation.cmp
Posted by Jon Stevens <jo...@latchkey.com>.
on 12/20/2000 9:52 PM, "geirm@locus.apache.org" <ge...@locus.apache.org>
wrote:
> +
> +Now, non interpolated stringlits :
> +
> +
> + False
I don't think that the space in front of the False should be there.
-jon