aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/test-util.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/test-util.js b/tests/test-util.js
index 54896ff..b10d485 100644
--- a/tests/test-util.js
+++ b/tests/test-util.js
@@ -83,14 +83,22 @@ exports.ensureFilterByRegexp = function (test) {
}
];
- test.assertEqual(util.filterByRegexp(list,"testing"),"correct",
+ test.assertEqual(util.filterByRegexp(list, "testing"), "correct",
"simple testing of filterByRegexp");
- test.assertEqual(util.filterByRegexp(list,"unknown value"),"",
+ test.assertEqual(util.filterByRegexp(list, "unknown value"), "",
"simple testing of filterByRegexp with non-found address");
- test.assert(util.filterByRegexp(list,"baaad"),
+ test.assert(util.filterByRegexp(list, "baaad"),
"simple testing of filterByRegexp with non-string return value");
};
+exports.ensureFilterByRegexpEmpty = function (test) {
+ test.assertRaises(function () {
+ util.filterByRegexp(undefined, "tralala");
+ },
+ "list is undefined",
+ "filterByRegexp throws an exception with empty list");
+};
+
// testing util.getISODate
exports.ensureGetISODate = function (test) {
test.assertEqual(util.getISODate("Mon May 31 2010 23:29:09 GMT+0200 (CET)"),
@@ -175,6 +183,6 @@ exports.ensureGetObjectKeys = function (test) {
b: 2
};
test.assertEqual(JSON.stringify(util.getObjectKeys(testObj)),
- JSON.stringify(["a","b"]),
+ JSON.stringify(["a", "b"]),
"getting keys from a object");
}; \ No newline at end of file