diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-04-17 08:44:49 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-06-05 14:44:43 +0200 |
commit | 0ccc730b8cf0f66a8e9a15cc07b5b6613fc0e015 (patch) | |
tree | 3dece2704b161fce5ef4e963a18aec624a782ee9 /tests/test-xmlrpc.js | |
parent | 4d29c8b4eb1f3e66da8d60fd1f42f3e4c06d2b39 (diff) | |
download | bugzilla-triage-0ccc730b8cf0f66a8e9a15cc07b5b6613fc0e015.tar.gz |
Auch! Say NO to the copy&paste inheritance!
* leadingZero made into special function exported from xmlrpc module
(it is now able to accept either number of string as its parameter)
* added tests for leadingZero
Diffstat (limited to 'tests/test-xmlrpc.js')
-rw-r--r-- | tests/test-xmlrpc.js | 13 |
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"); |