1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/testprogs/ejs/base.js
Andrew Bartlett 7d4da6897c r17547: Add test by mkhl for some of our variable substituion behaviour.
Andrew Bartlett
(This used to be commit c2c72565e4)
2007-10-10 14:15:36 -05:00

16 lines
355 B
JavaScript
Executable File

#!/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);