diff options
Diffstat (limited to 'chrome/content')
-rw-r--r-- | chrome/content/unittests.html | 4 | ||||
-rw-r--r-- | chrome/content/unittests.js | 16 |
2 files changed, 12 insertions, 8 deletions
diff --git a/chrome/content/unittests.html b/chrome/content/unittests.html index cee8488..0989562 100644 --- a/chrome/content/unittests.html +++ b/chrome/content/unittests.html @@ -1,4 +1,4 @@ -<!-- $Id: help.html 210 2009-05-10 05:20:55Z einar@einaregilsson.com $ -->
+<!-- $Id$ -->
<html>
<head>
<title>Redirector Unit Tests</title>
@@ -45,7 +45,6 @@ }
function setup() {
- try{
var tables = document.getElementsByTagName('table');
for (var i = 0; i < tables.length; i++) {
tables[i].parentNode.removeChild(tables[i]);
@@ -57,7 +56,6 @@ for (var name in tests) {
setupTest(name, tests[name]);
}
- }catch(e){alert(e);}
}
function runTests() {
diff --git a/chrome/content/unittests.js b/chrome/content/unittests.js index 095b13b..ea6e26b 100644 --- a/chrome/content/unittests.js +++ b/chrome/content/unittests.js @@ -1,4 +1,4 @@ -
+//// $Id$
var tests = {
"Wildcard matches" : {
run : function(data) {
@@ -17,17 +17,23 @@ var tests = { return result == expected;
},
- describe : function(data) { return data[0] + ' matches ' + data[1] + ', matches=' + data[2]; },
+ describe : function(data) { return data[0] + ' == ' + data[1] + ', matches=' + data[2]; },
tests : [
['http://foo*', 'http://foobar.is', 'bar.is'],
['http://foo*', 'http://foo', ''],
+ ['*://foo.is', 'http://foo.is', 'http'],
+ ['*http://foo.is', 'http://foo.is', ''],
+ ['http*foo*', 'http://foobar.is', '://,bar.is'],
+ ['http*foo*', 'http://foo', '://,'],
+ ['*://f*.is', 'http://foo.is', 'http,oo'],
+ ['*http://f*.is', 'http://foo.is', ',oo'],
['*foo*', 'http://foo', 'http://,'],
+ ['*foo*', 'foobar.is', ',bar.is'],
['*foo*', 'http://foobar.is', 'http://,bar.is'],
['http://foo.is', 'http://foo.is', ''],
['*', 'http://foo.is', 'http://foo.is'],
- ['*://foo.is', 'http://foo.is', 'http'],
- ['*://foo.is*', 'http://foo.is/bar/baz', 'http,/bar/baz'],
- ['*://*oo*bar*', 'http://foo.is/bar/baz', 'http,f,.is/,/baz']
+ ['*://*oo*bar*', 'http://foo.is/bar/baz', 'http,f,.is/,/baz'],
+ ['*://**oo*bar*', 'http://foo.is/bar/baz', 'http,,f,.is/,/baz'],
]
}
};
|