5 { data
: "bar.foo.co.uk", result
: "foo.co.uk" },
6 { data
: "foo.bar.foo.co.uk", result
: "bar.foo.co.uk" },
7 { data
: "foo.co.uk", throw: true },
8 { data
: "co.uk", throw: true },
9 { data
: ".co.uk", throw: true },
10 { data
: "com", throw: true },
11 { data
: "tûlîp.foo.fr", result
: "foo.fr" },
12 { data
: "tûlîp.fôû.fr", result
: "xn--f-xgav.fr" },
13 { data
: "file://foo/bar", throw: true },
16 tests
.forEach(function (test
) {
18 var r
= Services
.eTLD
.getNextSubDomain(test
.data
);
19 Assert
.equal(r
, test
.result
);
21 Assert
.ok(test
.throw);