summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-15 02:25:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:36 -0500
commit7d4da6897c547bafbe41cb7acf5dc2fcf387b4bb (patch)
tree7bcb6bfe5c60ef2fceba6ad962004ba479d19a99 /testprogs/ejs
parentb7cef043519664ecff726c7e2bf9b0ce024e892b (diff)
downloadsamba-7d4da6897c547bafbe41cb7acf5dc2fcf387b4bb.tar.gz
samba-7d4da6897c547bafbe41cb7acf5dc2fcf387b4bb.tar.bz2
samba-7d4da6897c547bafbe41cb7acf5dc2fcf387b4bb.zip
r17547: Add test by mkhl for some of our variable substituion behaviour.
Andrew Bartlett (This used to be commit c2c72565e4efef44068c4f176619942f60a9cf6e)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/base.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/testprogs/ejs/base.js b/testprogs/ejs/base.js
new file mode 100755
index 0000000000..fddf64264c
--- /dev/null
+++ b/testprogs/ejs/base.js
@@ -0,0 +1,15 @@
+#!/bin/sh
+exec smbscript "$0" ${1+"$@"}
+libinclude("base.js");
+
+var obj = new Object();
+obj.FOO = "foo";
+obj.BAR = "bar";
+var str1 = "${FOO}:${BAR}";
+var str2 = "${FOO}:${BAR} "; // note the space after the brace
+var sub1 = substitute_var(str1, obj);
+var sub2 = substitute_var(str2, obj);
+
+assert(str1 + " " == str2);
+assert(sub1 + " " == sub2);
+exit(0);