aboutsummaryrefslogtreecommitdiff
path: root/chrome/content/unittests.js
diff options
context:
space:
mode:
authorEinar Egilsson2009-09-15 08:12:49 +0000
committerEinar Egilsson2009-09-15 08:12:49 +0000
commitd32cd776748e45abeaa6c2284b96210952c79717 (patch)
tree54e2798d9350caf54cccd90820402aa611aad760 /chrome/content/unittests.js
parent50d488f4c2137206e63f291ff99c4f09d177d31d (diff)
Fixed properties and added some more unittests
git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@248 119bf307-c92d-0410-89bd-8f53e6181181
Diffstat (limited to 'chrome/content/unittests.js')
-rw-r--r--chrome/content/unittests.js16
1 files changed, 11 insertions, 5 deletions
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'],
]
}
};