aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test-xmlrpc.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-xmlrpc.js')
-rw-r--r--tests/test-xmlrpc.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test-xmlrpc.js b/tests/test-xmlrpc.js
index 677a581..f3f2e56 100644
--- a/tests/test-xmlrpc.js
+++ b/tests/test-xmlrpc.js
@@ -15,6 +15,19 @@ var xmlOut = "<?xml version=\"1.0\"?>\n" +
"<param>\n<value><boolean>1</boolean></value>\n</param>\n" +
"</params>\n</methodCall>";
+exports.ensureLeadingZero = function (test) {
+ test.assert(typeof(xrpc.leadingZero) == "function");
+ test.assertEqual(xrpc.leadingZero("1"), "01");
+ test.assertEqual(xrpc.leadingZero(1), "01");
+ test.assertEqual(xrpc.leadingZero("11"), "11");
+ test.assertEqual(xrpc.leadingZero(11), "11");
+ test.assertEqual(xrpc.leadingZero("111"), "111");
+ test.assertEqual(xrpc.leadingZero(111), "111");
+ test.assertEqual(xrpc.leadingZero("-1"), "-1");
+ test.assertEqual(xrpc.leadingZero(-1), "-1");
+ test.assertEqual(xrpc.leadingZero("zzz"),"zzz");
+};
+
// testing xrpc.XMLRPCMessage
exports.ensureGenerateXMLRPC = function (test) {
var msg = new xrpc.XMLRPCMessage("bugzilla.updateAttachMimeType");