summaryrefslogtreecommitdiff
path: root/testprogs/ejs/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'testprogs/ejs/base.js')
-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);