Lines Matching refs:t

13     var t = new TestContext(test);
16 Tests[test](t);
18 if (t.failed()) {
35 Tests.testDnsDomainIs = function(t) { argument
36 t.expectTrue(dnsDomainIs("google.com", ".com"));
37 t.expectTrue(dnsDomainIs("google.co.uk", ".co.uk"));
38 t.expectFalse(dnsDomainIs("google.com", ".co.uk"));
39 t.expectFalse(dnsDomainIs("www.adobe.com", ".ad"));
42 Tests.testDnsDomainLevels = function(t) { argument
43 t.expectEquals(0, dnsDomainLevels("www"));
44 t.expectEquals(2, dnsDomainLevels("www.google.com"));
45 t.expectEquals(3, dnsDomainLevels("192.168.1.1"));
48 Tests.testIsInNet = function(t) { argument
49 t.expectTrue(
51 t.expectFalse(
54 t.expectTrue(isInNet("192.89.132.25", "192.89.0.0", "255.255.0.0"));
55 t.expectFalse(isInNet("193.89.132.25", "192.89.0.0", "255.255.0.0"));
57 t.expectFalse(
61 Tests.testIsPlainHostName = function(t) { argument
62 t.expectTrue(isPlainHostName("google"));
63 t.expectFalse(isPlainHostName("google.com"));
66 Tests.testLocalHostOrDomainIs = function(t) { argument
67 t.expectTrue(localHostOrDomainIs("www.google.com", "www.google.com"));
68 t.expectTrue(localHostOrDomainIs("www", "www.google.com"));
69 t.expectFalse(localHostOrDomainIs("maps.google.com", "www.google.com"));
72 Tests.testShExpMatch = function(t) { argument
73 t.expectTrue(shExpMatch("foo.jpg", "*.jpg"));
74 t.expectTrue(shExpMatch("foo5.jpg", "*o?.jpg"));
75 t.expectFalse(shExpMatch("foo.jpg", ".jpg"));
76 t.expectFalse(shExpMatch("foo.jpg", "foo"));
79 Tests.testSortIpAddressList = function(t) { argument
80 t.expectEquals("::1;::2;::3", sortIpAddressList("::2;::3;::1"));
81 t.expectEquals(
88 t.expectEquals("127.0.0.1", sortIpAddressList("127.0.0.1"));
89 t.expectEquals("::1", sortIpAddressList("::1"))
92 t.expectEquals("0:0::1;192.168.1.1", sortIpAddressList("192.168.1.1;0:0::1"));
95 t.expectEquals("::1;192.168.1.3", sortIpAddressList("::1;192.168.1.3"));
98 t.expectEquals("0::1;::1;0:0::1", sortIpAddressList("0::1;::1;0:0::1"));
101 t.expectEquals("127.0.0.1", sortIpAddressList(";127.0.0.1;"));
104 t.expectEquals("192.168.0.1;192.168.0.2",
106 t.expectEquals("127.0.0.0;127.0.0.1;127.0.0.2",
110 t.expectFalse(sortIpAddressList(""));
111 t.expectFalse(sortIpAddressList(" "));
112 t.expectFalse(sortIpAddressList(";"));
113 t.expectFalse(sortIpAddressList(";;"));
114 t.expectFalse(sortIpAddressList(" ; ; "));
117 t.expectFalse(sortIpAddressList("256.0.0.1"));
118 t.expectFalse(sortIpAddressList("192.168.1.1;0:0:0:1;127.0.0.1"));
121 t.expectEquals(null, sortIpAddressList());
122 t.expectEquals(null, sortIpAddressList(null));
123 t.expectEquals(null, sortIpAddressList(null, null));
126 Tests.testIsInNetEx = function(t) { argument
127 t.expectTrue(isInNetEx("198.95.249.79", "198.95.249.79/32"));
128 t.expectTrue(isInNetEx("198.95.115.10", "198.95.0.0/16"));
129 t.expectTrue(isInNetEx("198.95.1.1", "198.95.0.0/16"));
130 t.expectTrue(isInNetEx("198.95.1.1", "198.95.3.3/16"));
131 t.expectTrue(isInNetEx("0:0:0:0:0:0:7f00:1", "0:0:0:0:0:0:7f00:1/32"));
132 t.expectTrue(isInNetEx("3ffe:8311:ffff:abcd:1234:dead:beef:101",
136 t.expectFalse(isInNetEx("127.0.0.1", "0:0:0:0:0:0:7f00:1/16"));
137 t.expectFalse(isInNetEx("192.168.24.3", "fe80:0:0:0:0:0:c0a8:1803/32"));
139 t.expectFalse(isInNetEx("198.95.249.78", "198.95.249.79/32"));
140 t.expectFalse(isInNetEx("198.96.115.10", "198.95.0.0/16"));
141 t.expectFalse(isInNetEx("3fff:8311:ffff:abcd:1234:dead:beef:101",
145 t.expectEquals(null, isInNetEx());
146 t.expectEquals(null, isInNetEx(null));
147 t.expectEquals(null, isInNetEx(null, null));
148 t.expectEquals(null, isInNetEx(null, null, null));
149 t.expectEquals(null, isInNetEx("198.95.249.79"));
152 t.expectFalse(isInNetEx("256.0.0.1", "198.95.249.79"));
153 t.expectFalse(isInNetEx("127.0.0.1 ", "127.0.0.1/32")); // Extra space.
156 t.expectFalse(isInNetEx("198.95.115.10", "198.95.0.0/34"));
157 t.expectFalse(isInNetEx("127.0.0.1", "127.0.0.1")); // Missing '/' in prefix.
160 Tests.testWeekdayRange = function(t) { argument
163 t.expectEquals(true, weekdayRange("MON", "FRI"));
164 t.expectEquals(true, weekdayRange("TUE", "FRI"));
165 t.expectEquals(true, weekdayRange("TUE", "TUE"));
166 t.expectEquals(true, weekdayRange("TUE"));
167 t.expectEquals(false, weekdayRange("WED", "FRI"));
168 t.expectEquals(false, weekdayRange("SUN", "MON"));
169 t.expectEquals(false, weekdayRange("SAT"));
170 t.expectEquals(false, weekdayRange("FRI", "MON"));
174 t.expectEquals(true, weekdayRange("MON", "FRI", "GMT"));
175 t.expectEquals(true, weekdayRange("TUE", "FRI", "GMT"));
176 t.expectEquals(true, weekdayRange("TUE", "TUE", "GMT"));
177 t.expectEquals(true, weekdayRange("TUE", "GMT"));
178 t.expectEquals(false, weekdayRange("WED", "FRI", "GMT"));
179 t.expectEquals(false, weekdayRange("SUN", "MON", "GMT"));
180 t.expectEquals(false, weekdayRange("SAT", "GMT"));
183 Tests.testDateRange = function(t) { argument
186 t.expectEquals(true, dateRange(3));
187 t.expectEquals(false, dateRange(1));
191 t.expectEquals(true, dateRange(3, "GMT"));
192 t.expectEquals(false, dateRange(1, "GMT"));
196 t.expectEquals(true, dateRange(1, 4));
197 t.expectEquals(false, dateRange(4, 20));
201 t.expectEquals(true, dateRange(3, "MAR"));
203 t.expectEquals(true, dateRange(3, "MAR"));
210 t.expectEquals(true, dateRange(3, "MAR", 2009));
211 t.expectEquals(false, dateRange(4, "MAR", 2009));
212 t.expectEquals(false, dateRange(3, "FEB", 2009));
214 t.expectEquals(false, dateRange(3, "MAR", 2009));
218 t.expectEquals(true, dateRange("JAN", "MAR"));
219 t.expectEquals(true, dateRange("MAR", "APR"));
220 t.expectEquals(false, dateRange("MAY", "SEP"));
224 t.expectEquals(true, dateRange(1, "JAN", 3, "MAR"));
225 t.expectEquals(true, dateRange(3, "MAR", 4, "SEP"));
226 t.expectEquals(false, dateRange(4, "MAR", 4, "SEP"));
230 t.expectEquals(true, dateRange("FEB", 2009, "MAR", 2009));
232 t.expectEquals(true, dateRange("FEB", 2009, "MAR", 2010));
233 t.expectEquals(false, dateRange("FEB", 2009, "MAR", 2009));
237 t.expectEquals(true, dateRange(1, "JAN", 2009, 3, "MAR", 2009));
238 t.expectEquals(true, dateRange(3, "MAR", 2009, 4, "SEP", 2009));
239 t.expectEquals(true, dateRange(3, "JAN", 2009, 4, "FEB", 2010));
240 t.expectEquals(false, dateRange(4, "MAR", 2009, 4, "SEP", 2009));
243 Tests.testTimeRange = function(t) { argument
246 t.expectEquals(true, timeRange(3));
247 t.expectEquals(false, timeRange(2));
251 t.expectEquals(true, timeRange(2, 3));
252 t.expectEquals(true, timeRange(2, 4));
253 t.expectEquals(true, timeRange(3, 5));
254 t.expectEquals(false, timeRange(1, 2));
255 t.expectEquals(false, timeRange(11, 12));
259 t.expectEquals(true, timeRange(1, 0, 3, 34));
260 t.expectEquals(true, timeRange(1, 0, 3, 35));
261 t.expectEquals(true, timeRange(3, 34, 5, 0));
262 t.expectEquals(false, timeRange(1, 0, 3, 0));
263 t.expectEquals(false, timeRange(11, 0, 16, 0));
267 t.expectEquals(true, timeRange(1, 0, 0, 3, 34, 14));
268 t.expectEquals(false, timeRange(1, 0, 0, 3, 34, 0));
269 t.expectEquals(true, timeRange(1, 0, 0, 3, 35, 0));
270 t.expectEquals(true, timeRange(3, 34, 0, 5, 0, 0));
271 t.expectEquals(false, timeRange(1, 0, 0, 3, 0, 0));
272 t.expectEquals(false, timeRange(11, 0, 0, 16, 0, 0));