summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);