summaryrefslogtreecommitdiff
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
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)
-rwxr-xr-xsource4/script/tests/test_ejs.sh2
-rwxr-xr-xtestprogs/ejs/base.js15
2 files changed, 17 insertions, 0 deletions
diff --git a/source4/script/tests/test_ejs.sh b/source4/script/tests/test_ejs.sh
index aabefcf233..3ad3ed2781 100755
--- a/source4/script/tests/test_ejs.sh
+++ b/source4/script/tests/test_ejs.sh
@@ -21,6 +21,8 @@ DATADIR=../testdata
PATH=bin:$PATH
export PATH
+testit "base.js" $SCRIPTDIR/base.js || failed=`expr $failed + 1`
+
for f in samr.js echo.js; do
testit "$f" $SCRIPTDIR/$f $CONFIGURATION ncalrpc: -U$USERNAME%$PASSWORD || failed=`expr $failed + 1`
done
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);