Corrections to work with the new escape rules.
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/jakarta/velocity/trunk@73535 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/templates/block.vm b/test/templates/block.vm
index 6e59d08..29e0f22 100644
--- a/test/templates/block.vm
+++ b/test/templates/block.vm
@@ -65,7 +65,7 @@
this is the else statement
#end
--- Third Test : tight tight tight. Note that \#end eats the \\n, which is NOT what people expect, I think.
+-- Third Test : tight tight tight. Note that \#end eats the \n, which is NOT what people expect, I think.
-- one blank line follows
blargh #if(true)This follows blargh#end
diff --git a/test/templates/compare/escape.cmp b/test/templates/compare/escape.cmp
index ce1b836..c762c31 100644
--- a/test/templates/compare/escape.cmp
+++ b/test/templates/compare/escape.cmp
@@ -1,7 +1,44 @@
-A
+\A
-#set $foo = "bar"
+#set $woo = "bar"
-$foo => bar
+$woo => bar
+
+The following should print 'as is' :
+$f\oo
+\a
+"\r"
+
+Now, test the built in directives. Note that $foo isn't in the context :
+#set $foo = $foo + 1
+#set \$foo = $foo + 1
+#if($foo)
+#if ( $foo )
+#else
+#end
+#elseif(
+
+Now, a reference not in the context:
+\$foo -> $foo
+#if($foo)
+#if(\$foo)
+
+Put it in :
+$foo -> 1
+#if(1)
+#if($foo)
+
+This isn't in the context, so we get the full monty :
+ \$woobie.blagh()
+
+The following two are references :
+ $provider.Title = lunatic
+ $provider.getTitle() = lunatic
+
+Now, pluggable directives:
+
+\#notadirective
+#foreach
+
diff --git a/test/templates/compare/test.cmp b/test/templates/compare/test.cmp
index ba81793..4d50519 100644
--- a/test/templates/compare/test.cmp
+++ b/test/templates/compare/test.cmp
@@ -30,12 +30,12 @@
$foo. => bar.
$foo.. => bar..
$foo/ => bar/
-$foo" => bar"
-$foo => bar\
+$foo" => $foo"
+$foo\ => bar\
$foo< => bar<
-$foo- => $foo-
-$fooo+ => $fooo+
-$foo-x => $foo-x
+\$foo- => $foo-
+\$fooo+ => $fooo+
+\$foo-x => $foo-x
$foo$ => bar
@@ -148,8 +148,8 @@
(this is also great)
-This is the #stuff and this
-is the way #to #go.
+This is the \#stuff and this
+is the way \#to \#go.
this = that
diff --git a/test/templates/escape.vm b/test/templates/escape.vm
index 9a1e13f..c809395 100644
--- a/test/templates/escape.vm
+++ b/test/templates/escape.vm
@@ -11,7 +11,45 @@
\A
-\#set $foo = "bar"
-#set $foo = "bar"
+\#set $woo = "bar"
+#set $woo = "bar"
-\$foo => $foo
+\$woo => $woo
+
+The following should print 'as is' :
+$f\oo
+\a
+"\r"
+
+Now, test the built in directives. Note that $foo isn't in the context :
+\#set $foo = $foo + 1
+\#set \$foo = $foo + 1
+\#if($foo)
+\#if ( $foo )
+\#else
+\#end
+\#elseif(
+
+Now, a reference not in the context:
+\$foo -> $foo
+\#if($foo)
+\#if(\$foo)
+
+Put it in :
+#set $foo = 1
+\$foo -> $foo
+\#if($foo)
+\#if(\$foo)
+
+This isn't in the context, so we get the full monty :
+ \$woobie.blagh()
+
+The following two are references :
+ \$provider.Title = $provider.Title
+ \$provider.getTitle() = $provider.getTitle()
+
+Now, pluggable directives:
+
+\#notadirective
+\#foreach
+
diff --git a/test/templates/pedantic.vm b/test/templates/pedantic.vm
index 03483c4..e05ec0d 100644
--- a/test/templates/pedantic.vm
+++ b/test/templates/pedantic.vm
@@ -16,7 +16,7 @@
Like get the spacing between things #foreach($a in $stringarray)$a#end to be really, really tight.
-Further, it now binds any \\n to the control structures, taking them out of the output.
+Further, it now binds any \n to the control structures, taking them out of the output.
The hope that this is What You Expect.
So...