diff options
Diffstat (limited to 'testprogs/ejs/sprintf.js')
-rwxr-xr-x | testprogs/ejs/sprintf.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/testprogs/ejs/sprintf.js b/testprogs/ejs/sprintf.js deleted file mode 100755 index 6ae8605718..0000000000 --- a/testprogs/ejs/sprintf.js +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env smbscript -/* - test sprintf function -*/ - -string_init(local); - -function check_result(s, v) -{ - if (s != v) { - println("expected '" + v + "' but got '" + s + "'"); - } - assert(s == v); -} - -function xprintf() -{ - return "XX{" + vsprintf(arguments) + "}XX"; -} - -check_result(sprintf("%d", 7), "7"); -check_result(sprintf("%04d", 42), "0042"); -check_result(sprintf("my string=%7.2s", "foo%7"), "my string= fo"); -check_result(sprintf("blah=0x%*x", 4, 19), "blah=0x 13"); -check_result(sprintf("blah=0x%0*x", 4, 19), "blah=0x0013"); -check_result(sprintf("blah=%.0f", 1032), "blah=1032"); -check_result(sprintf("%4.2f%%", 72.32), "72.32%"); - -check_result(xprintf("%4.2f%% and %s", 72.32, "foo"),"XX{72.32% and foo}XX"); - -println("ALL OK"); |