aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-06-05 01:13:12 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-06-05 01:13:12 +0200
commit2b95e7ae6cb53f987931de8f567870b9e69cdf9a (patch)
tree9280099d9a70ea4f1c45734fe1b13944eb599f21 /tests
parent4f2e73837a000844c75bfa70d1be5debc0ac4859 (diff)
downloadbugzilla-triage-2b95e7ae6cb53f987931de8f567870b9e69cdf9a.tar.gz
Unfinished mess of everything, unworking.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-util.js38
1 files changed, 30 insertions, 8 deletions
diff --git a/tests/test-util.js b/tests/test-util.js
index 0621ad9..a9d0e6a 100644
--- a/tests/test-util.js
+++ b/tests/test-util.js
@@ -73,6 +73,27 @@ exports.ensureIsInListNoMember = function (test) {
"conversion of a string to an array");
};
+// testing util.filterByRegexp
+exports.ensureFilterByRegexp = function (test) {
+ var list = [
+ {
+ "regexp": "test(ing|ed)",
+ "addr": "correct"
+ },
+ {
+ "regexp": "ba.*d",
+ "addr": true
+ }
+ ];
+
+ test.assertEqual(util.filterByRegexp(list,"testing"),"correct",
+ "simple testing of filterByRegexp");
+ test.assertEqual(util.filterByRegexp(list,"unknown value"),"",
+ "simple testing of filterByRegexp with non-found address");
+ test.assert(util.filterByRegexp(list,"baaad"),
+ "simple testing of filterByRegexp with non-string return value");
+};
+
// testing util.getISODate
exports.ensureGetISODate = function (test) {
test.assertEqual(util.getISODate("Mon May 31 2010 23:29:09 GMT+0200 (CET)"),
@@ -160,14 +181,15 @@ exports.ensureLoadText = function (test) {
});
};
-//exports.ensureLoadTextUnicode = function (test) {
-// var url = "http://matej.ceplovi.cz/progs/data/pushkin.txt", text = "";
-// test.waitUntilDone();
-// util.loadText(url, function (txt) {
-// test.assertEqual(txt, pushkinTestString);
-// test.done();
-// });
-//};
+// exports.ensureLoadTextUnicode = function (test) {
+// var url = "http://matej.ceplovi.cz/progs/data/pushkin.txt", text = "";
+// test.waitUntilDone();
+// util.loadText(url, function (txt) {
+// console.log(txt);
+// //test.assertEqual(txt, pushkinTestString);
+// test.done();
+// });
+// };
//// testing util.loadJSON
exports.ensureLoadJSON = function (test) {