Bug 1322782 - Fixed coding style in MatchPattern tests. r=kmag a=test-only
authorLuca Greco <lgreco@mozilla.com>
Tue, 20 Dec 2016 23:22:57 -0500
changeset 369306 ef2f580696412a177cbb45264e15478053a8d4a0
parent 369305 e39019e1dffa9336570a99b4557ce73b5989e8eb
child 369307 6b30b9e29267cd75fc261cf63b65bfa4eba00b39
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag, test-only
bugs1322782
milestone52.0
Bug 1322782 - Fixed coding style in MatchPattern tests. r=kmag a=test-only MozReview-Commit-ID: JsF5J5vyeLQ
toolkit/modules/tests/xpcshell/test_MatchPattern.js
--- a/toolkit/modules/tests/xpcshell/test_MatchPattern.js
+++ b/toolkit/modules/tests/xpcshell/test_MatchPattern.js
@@ -21,75 +21,75 @@ function pass({url, pattern})
 function fail({url, pattern})
 {
   do_check_false(test(url, pattern), `Expected no match: ${JSON.stringify(pattern)}, ${url}`);
 }
 
 function run_test()
 {
   // Invalid pattern.
-  fail({url:"http://mozilla.org", pattern:""});
+  fail({url: "http://mozilla.org", pattern: ""});
 
   // Pattern must include trailing slash.
-  fail({url:"http://mozilla.org", pattern:"http://mozilla.org"});
+  fail({url: "http://mozilla.org", pattern: "http://mozilla.org"});
 
   // Protocol not allowed.
-  fail({url:"http://mozilla.org", pattern:"gopher://wuarchive.wustl.edu/"});
+  fail({url: "http://mozilla.org", pattern: "gopher://wuarchive.wustl.edu/"});
 
-  pass({url:"http://mozilla.org", pattern:"http://mozilla.org/"});
-  pass({url:"http://mozilla.org/", pattern:"http://mozilla.org/"});
+  pass({url: "http://mozilla.org", pattern: "http://mozilla.org/"});
+  pass({url: "http://mozilla.org/", pattern: "http://mozilla.org/"});
 
-  pass({url:"http://mozilla.org/", pattern:"*://mozilla.org/"});
-  pass({url:"https://mozilla.org/", pattern:"*://mozilla.org/"});
-  fail({url:"file://mozilla.org/", pattern:"*://mozilla.org/"});
-  fail({url:"ftp://mozilla.org/", pattern:"*://mozilla.org/"});
+  pass({url: "http://mozilla.org/", pattern: "*://mozilla.org/"});
+  pass({url: "https://mozilla.org/", pattern: "*://mozilla.org/"});
+  fail({url: "file://mozilla.org/", pattern: "*://mozilla.org/"});
+  fail({url: "ftp://mozilla.org/", pattern: "*://mozilla.org/"});
 
-  fail({url:"http://mozilla.com", pattern:"http://*mozilla.com*/"});
-  fail({url:"http://mozilla.com", pattern:"http://mozilla.*/"});
-  fail({url:"http://mozilla.com", pattern:"http:/mozilla.com/"});
+  fail({url: "http://mozilla.com", pattern: "http://*mozilla.com*/"});
+  fail({url: "http://mozilla.com", pattern: "http://mozilla.*/"});
+  fail({url: "http://mozilla.com", pattern: "http:/mozilla.com/"});
 
-  pass({url:"http://google.com", pattern:"http://*.google.com/"});
-  pass({url:"http://docs.google.com", pattern:"http://*.google.com/"});
+  pass({url: "http://google.com", pattern: "http://*.google.com/"});
+  pass({url: "http://docs.google.com", pattern: "http://*.google.com/"});
 
-  pass({url:"http://mozilla.org:8080", pattern:"http://mozilla.org/"});
-  pass({url:"http://mozilla.org:8080", pattern:"*://mozilla.org/"});
-  fail({url:"http://mozilla.org:8080", pattern:"http://mozilla.org:8080/"});
+  pass({url: "http://mozilla.org:8080", pattern: "http://mozilla.org/"});
+  pass({url: "http://mozilla.org:8080", pattern: "*://mozilla.org/"});
+  fail({url: "http://mozilla.org:8080", pattern: "http://mozilla.org:8080/"});
 
   // Now try with * in the path.
-  pass({url:"http://mozilla.org", pattern:"http://mozilla.org/*"});
-  pass({url:"http://mozilla.org/", pattern:"http://mozilla.org/*"});
+  pass({url: "http://mozilla.org", pattern: "http://mozilla.org/*"});
+  pass({url: "http://mozilla.org/", pattern: "http://mozilla.org/*"});
 
-  pass({url:"http://mozilla.org/", pattern:"*://mozilla.org/*"});
-  pass({url:"https://mozilla.org/", pattern:"*://mozilla.org/*"});
-  fail({url:"file://mozilla.org/", pattern:"*://mozilla.org/*"});
-  fail({url:"http://mozilla.com", pattern:"http://mozilla.*/*"});
+  pass({url: "http://mozilla.org/", pattern: "*://mozilla.org/*"});
+  pass({url: "https://mozilla.org/", pattern: "*://mozilla.org/*"});
+  fail({url: "file://mozilla.org/", pattern: "*://mozilla.org/*"});
+  fail({url: "http://mozilla.com", pattern: "http://mozilla.*/*"});
 
-  pass({url:"http://google.com", pattern:"http://*.google.com/*"});
-  pass({url:"http://docs.google.com", pattern:"http://*.google.com/*"});
+  pass({url: "http://google.com", pattern: "http://*.google.com/*"});
+  pass({url: "http://docs.google.com", pattern: "http://*.google.com/*"});
 
   // Check path stuff.
-  fail({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/"});
-  pass({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/*"});
-  pass({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/a*f"});
-  pass({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/a*"});
-  pass({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/*f"});
-  fail({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/*e"});
-  fail({url:"http://mozilla.com/abc/def", pattern:"http://mozilla.com/*c"});
+  fail({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/"});
+  pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*"});
+  pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/a*f"});
+  pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/a*"});
+  pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*f"});
+  fail({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*e"});
+  fail({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*c"});
 
-  fail({url:"http:///a.html", pattern:"http:///a.html"});
-  pass({url:"file:///foo", pattern:"file:///foo*"});
-  pass({url:"file:///foo/bar.html", pattern:"file:///foo*"});
+  fail({url: "http:///a.html", pattern: "http:///a.html"});
+  pass({url: "file:///foo", pattern: "file:///foo*"});
+  pass({url: "file:///foo/bar.html", pattern: "file:///foo*"});
 
-  pass({url:"http://mozilla.org/a", pattern:"<all_urls>"});
-  pass({url:"https://mozilla.org/a", pattern:"<all_urls>"});
-  pass({url:"ftp://mozilla.org/a", pattern:"<all_urls>"});
-  pass({url:"file:///a", pattern:"<all_urls>"});
-  fail({url:"gopher://wuarchive.wustl.edu/a", pattern:"<all_urls>"});
+  pass({url: "http://mozilla.org/a", pattern: "<all_urls>"});
+  pass({url: "https://mozilla.org/a", pattern: "<all_urls>"});
+  pass({url: "ftp://mozilla.org/a", pattern: "<all_urls>"});
+  pass({url: "file:///a", pattern: "<all_urls>"});
+  fail({url: "gopher://wuarchive.wustl.edu/a", pattern: "<all_urls>"});
 
   // Multiple patterns.
-  pass({url:"http://mozilla.org", pattern:["http://mozilla.org/"]});
-  pass({url:"http://mozilla.org", pattern:["http://mozilla.org/", "http://mozilla.com/"]});
-  pass({url:"http://mozilla.com", pattern:["http://mozilla.org/", "http://mozilla.com/"]});
-  fail({url:"http://mozilla.biz", pattern:["http://mozilla.org/", "http://mozilla.com/"]});
+  pass({url: "http://mozilla.org", pattern: ["http://mozilla.org/"]});
+  pass({url: "http://mozilla.org", pattern: ["http://mozilla.org/", "http://mozilla.com/"]});
+  pass({url: "http://mozilla.com", pattern: ["http://mozilla.org/", "http://mozilla.com/"]});
+  fail({url: "http://mozilla.biz", pattern: ["http://mozilla.org/", "http://mozilla.com/"]});
 
   // Match url with fragments.
   pass({url: "http://mozilla.org/base#some-fragment", pattern: "http://mozilla.org/base"});
 }