aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/test/resources/templates/escape.vm
diff options
context:
space:
mode:
Diffstat (limited to 'velocity-engine-core/src/test/resources/templates/escape.vm')
-rw-r--r--velocity-engine-core/src/test/resources/templates/escape.vm55
1 files changed, 55 insertions, 0 deletions
diff --git a/velocity-engine-core/src/test/resources/templates/escape.vm b/velocity-engine-core/src/test/resources/templates/escape.vm
new file mode 100644
index 00000000..aedf8f42
--- /dev/null
+++ b/velocity-engine-core/src/test/resources/templates/escape.vm
@@ -0,0 +1,55 @@
+#*
+
+@test escape.vm
+
+This template is used for Velocity regression testing.
+If you alter this template make sure you change the
+corresponding comparison file so that the regression
+test doesn't fail incorrectly.
+
+*#
+
+\A
+
+\#set($woo = "bar")
+#set($woo = "bar")
+
+\$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
+