aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-04-17 08:44:49 +0200
committerMatěj Cepl <mcepl@redhat.com>2011-04-17 09:43:09 +0200
commit90506c39bb39ea3cbc77cbd22dd8179e94d46b68 (patch)
treead94dc96cfbde545759336b9965b575d46e0fa02 /tests
parent2facce309d8fbacc7364ff50df30aded4047181e (diff)
downloadbugzilla-triage-90506c39bb39ea3cbc77cbd22dd8179e94d46b68.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')
-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");