diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2020-07-14 15:24:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 15:24:17 -0400 |
commit | cde4dbb35132848ffece59ef9cfaccff32347124 (patch) | |
tree | cc7830968c6decde704c8cfb83c9185193dc698f /std/path/_globrex_test.ts | |
parent | 9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff) |
Use dprint for internal formatting (#6682)
Diffstat (limited to 'std/path/_globrex_test.ts')
-rw-r--r-- | std/path/_globrex_test.ts | 258 |
1 files changed, 129 insertions, 129 deletions
diff --git a/std/path/_globrex_test.ts b/std/path/_globrex_test.ts index 67a58cc64..19eabc983 100644 --- a/std/path/_globrex_test.ts +++ b/std/path/_globrex_test.ts @@ -11,7 +11,7 @@ function match( glob: string, strUnix: string, strWin?: string | object, - opts: GlobrexOptions = {} + opts: GlobrexOptions = {}, ): boolean { if (typeof strWin === "object") { opts = strWin; @@ -48,19 +48,19 @@ Deno.test({ t.equal( match("u*orn", "unicorn", { flags: "g" }), true, - "match the middle" + "match the middle", ); t.equal(match("ico", "unicorn"), false, "do not match without g"); t.equal( match("ico", "unicorn", { flags: "g" }), true, - 'match anywhere with RegExp "g"' + 'match anywhere with RegExp "g"', ); t.equal(match("u*nicorn", "unicorn"), true, "match zero characters"); t.equal( match("u*nicorn", "unicorn", { flags: "g" }), true, - "match zero characters" + "match zero characters", ); }, }); @@ -73,34 +73,34 @@ Deno.test({ globstar: false, }), true, - "complex match" + "complex match", ); t.equal( match("*.min.*", "http://example.com/jquery.min.js", { globstar: false }), true, - "complex match" + "complex match", ); t.equal( match("*/js/*.js", "http://example.com/js/jquery.min.js", { globstar: false, }), true, - "complex match" + "complex match", ); t.equal( match("*.min.*", "http://example.com/jquery.min.js", { flags: "g" }), true, - "complex match global" + "complex match global", ); t.equal( match("*.min.js", "http://example.com/jquery.min.js", { flags: "g" }), true, - "complex match global" + "complex match global", ); t.equal( match("*/js/*.js", "http://example.com/js/jquery.min.js", { flags: "g" }), true, - "complex match global" + "complex match global", ); const str = "\\/$^+?.()=!|{},[].*"; @@ -108,70 +108,70 @@ Deno.test({ t.equal( match(str, str, { flags: "g" }), true, - "battle test complex string - strict" + "battle test complex string - strict", ); t.equal( match(".min.", "http://example.com/jquery.min.js"), false, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("*.min.*", "http://example.com/jquery.min.js"), true, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match(".min.", "http://example.com/jquery.min.js", { flags: "g" }), true, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("http:", "http://example.com/jquery.min.js"), false, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("http:*", "http://example.com/jquery.min.js"), true, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("http:", "http://example.com/jquery.min.js", { flags: "g" }), true, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("min.js", "http://example.com/jquery.min.js"), false, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("*.min.js", "http://example.com/jquery.min.js"), true, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("min.js", "http://example.com/jquery.min.js", { flags: "g" }), true, - 'matches without/with using RegExp "g"' + 'matches without/with using RegExp "g"', ); t.equal( match("min", "http://example.com/jquery.min.js", { flags: "g" }), true, - 'match anywhere (globally) using RegExp "g"' + 'match anywhere (globally) using RegExp "g"', ); t.equal( match("/js/", "http://example.com/js/jquery.min.js", { flags: "g" }), true, - 'match anywhere (globally) using RegExp "g"' + 'match anywhere (globally) using RegExp "g"', ); t.equal(match("/js*jq*.js", "http://example.com/js/jquery.min.js"), false); t.equal( match("/js*jq*.js", "http://example.com/js/jquery.min.js", { flags: "g", }), - true + true, ); }, }); @@ -186,28 +186,28 @@ Deno.test({ const tester = (globstar: boolean): void => { t.equal( match("f?o", "foo", { extended: true, globstar, flags: "g" }), - true + true, ); t.equal( match("f?o", "fooo", { extended: true, globstar, flags: "g" }), - true + true, ); t.equal( match("f?o?", "fooo", { extended: true, globstar, flags: "g" }), - true + true, ); t.equal( match("?fo", "fooo", { extended: true, globstar, flags: "g" }), - false + false, ); t.equal( match("f?oo", "foo", { extended: true, globstar, flags: "g" }), - false + false, ); t.equal( match("foo?", "foo", { extended: true, globstar, flags: "g" }), - false + false, ); }; @@ -230,15 +230,15 @@ Deno.test({ const tester = (globstar: boolean): void => { t.equal( match("fo[oz]", "foo", { extended: true, globstar, flags: "g" }), - true + true, ); t.equal( match("fo[oz]", "foz", { extended: true, globstar, flags: "g" }), - true + true, ); t.equal( match("fo[oz]", "fog", { extended: true, globstar, flags: "g" }), - false + false, ); }; @@ -252,55 +252,55 @@ Deno.test({ fn(): void { t.equal( match("[[:alnum:]]/bar.txt", "a/bar.txt", { extended: true }), - true + true, ); t.equal( match("@([[:alnum:]abc]|11)/bar.txt", "11/bar.txt", { extended: true }), - true + true, ); t.equal( match("@([[:alnum:]abc]|11)/bar.txt", "a/bar.txt", { extended: true }), - true + true, ); t.equal( match("@([[:alnum:]abc]|11)/bar.txt", "b/bar.txt", { extended: true }), - true + true, ); t.equal( match("@([[:alnum:]abc]|11)/bar.txt", "c/bar.txt", { extended: true }), - true + true, ); t.equal( match("@([[:alnum:]abc]|11)/bar.txt", "abc/bar.txt", { extended: true }), - false + false, ); t.equal( match("@([[:alnum:]abc]|11)/bar.txt", "3/bar.txt", { extended: true }), - true + true, ); t.equal( match("[[:digit:]]/bar.txt", "1/bar.txt", { extended: true }), - true + true, ); t.equal( match("[[:digit:]b]/bar.txt", "b/bar.txt", { extended: true }), - true + true, ); t.equal( match("[![:digit:]b]/bar.txt", "a/bar.txt", { extended: true }), - true + true, ); t.equal( match("[[:alnum:]]/bar.txt", "!/bar.txt", { extended: true }), - false + false, ); t.equal( match("[[:digit:]]/bar.txt", "a/bar.txt", { extended: true }), - false + false, ); t.equal( match("[[:digit:]b]/bar.txt", "a/bar.txt", { extended: true }), - false + false, ); }, }); @@ -320,7 +320,7 @@ Deno.test({ globstar, flag: "g", }), - true + true, ); t.equal( match("foo{bar,baaz}", "foobar", { @@ -328,7 +328,7 @@ Deno.test({ globstar, flag: "g", }), - true + true, ); t.equal( match("foo{bar,baaz}", "foobuzz", { @@ -336,7 +336,7 @@ Deno.test({ globstar, flag: "g", }), - false + false, ); t.equal( match("foo{bar,b*z}", "foobuzz", { @@ -344,7 +344,7 @@ Deno.test({ globstar, flag: "g", }), - true + true, ); }; @@ -360,41 +360,41 @@ Deno.test({ match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://foo.baaz.com/jquery.min.js", - { extended: true } + { extended: true }, ), - true + true, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://moz.buzz.com/index.html", - { extended: true } + { extended: true }, ), - true + true, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://moz.buzz.com/index.htm", - { extended: true } + { extended: true }, ), - false + false, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://moz.bar.com/index.html", - { extended: true } + { extended: true }, ), - false + false, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://flozz.buzz.com/index.html", - { extended: true } + { extended: true }, ), - false + false, ); const tester = (globstar: boolean): void => { @@ -402,41 +402,41 @@ Deno.test({ match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://foo.baaz.com/jquery.min.js", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - true + true, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://moz.buzz.com/index.html", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - true + true, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://moz.buzz.com/index.htm", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - false + false, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://moz.bar.com/index.html", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - false + false, ); t.equal( match( "http://?o[oz].b*z.com/{*.js,*.html}", "http://flozz.buzz.com/index.html", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - false + false, ); }; @@ -453,17 +453,17 @@ Deno.test({ match( "http://foo.com/**/{*.js,*.html}", "http://foo.com/bar/jquery.min.js", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - true + true, ); t.equal( match( "http://foo.com/**/{*.js,*.html}", "http://foo.com/bar/baz/jquery.min.js", - { extended: true, globstar, flags: "g" } + { extended: true, globstar, flags: "g" }, ), - true + true, ); t.equal( match("http://foo.com/**", "http://foo.com/bar/baz/jquery.min.js", { @@ -471,7 +471,7 @@ Deno.test({ globstar, flags: "g", }), - true + true, ); }; @@ -488,7 +488,7 @@ Deno.test({ t.equal(match(testExtStr, testExtStr, { extended: true }), true); t.equal( match(testExtStr, testExtStr, { extended: true, globstar, flags: "g" }), - true + true, ); }; @@ -506,37 +506,37 @@ Deno.test({ t.equal(match("/foo/**", "/foo/bar/baz.txt", { globstar: true }), true); t.equal( match("/foo/*/*.txt", "/foo/bar/baz.txt", { globstar: true }), - true + true, ); t.equal( match("/foo/**/*.txt", "/foo/bar/baz.txt", { globstar: true }), - true + true, ); t.equal( match("/foo/**/*.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - true + true, ); t.equal(match("/foo/**/bar.txt", "/foo/bar.txt", { globstar: true }), true); t.equal( match("/foo/**/**/bar.txt", "/foo/bar.txt", { globstar: true }), - true + true, ); t.equal( match("/foo/**/*/baz.txt", "/foo/bar/baz.txt", { globstar: true }), - true + true, ); t.equal(match("/foo/**/*.txt", "/foo/bar.txt", { globstar: true }), true); t.equal( match("/foo/**/**/*.txt", "/foo/bar.txt", { globstar: true }), - true + true, ); t.equal( match("/foo/**/*/*.txt", "/foo/bar/baz.txt", { globstar: true }), - true + true, ); t.equal( match("**/*.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - true + true, ); t.equal(match("**/foo.txt", "foo.txt", { globstar: true }), true); t.equal(match("**/*.txt", "foo.txt", { globstar: true }), true); @@ -544,29 +544,29 @@ Deno.test({ t.equal(match("/foo/*.txt", "/foo/bar/baz.txt", { globstar: true }), false); t.equal( match("/foo/*/*.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - false + false, ); t.equal(match("/foo/*/bar.txt", "/foo/bar.txt", { globstar: true }), false); t.equal( match("/foo/*/*/baz.txt", "/foo/bar/baz.txt", { globstar: true }), - false + false, ); t.equal( match("/foo/**.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - false + false, ); t.equal( match("/foo/bar**/*.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - false + false, ); t.equal(match("/foo/bar**", "/foo/bar/baz.txt", { globstar: true }), false); t.equal( match("**/.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - false + false, ); t.equal( match("*/*.txt", "/foo/bar/baz/qux.txt", { globstar: true }), - false + false, ); t.equal(match("*/*.txt", "foo.txt", { globstar: true }), false); t.equal( @@ -574,65 +574,65 @@ Deno.test({ extended: true, globstar: true, }), - false + false, ); t.equal( match("http://foo.com/*", "http://foo.com/bar/baz/jquery.min.js", { globstar: true, }), - false + false, ); t.equal( match("http://foo.com/*", "http://foo.com/bar/baz/jquery.min.js", { globstar: false, }), - true + true, ); t.equal( match("http://foo.com/**", "http://foo.com/bar/baz/jquery.min.js", { globstar: true, }), - true + true, ); t.equal( match( "http://foo.com/*/*/jquery.min.js", "http://foo.com/bar/baz/jquery.min.js", - { globstar: true } + { globstar: true }, ), - true + true, ); t.equal( match( "http://foo.com/**/jquery.min.js", "http://foo.com/bar/baz/jquery.min.js", - { globstar: true } + { globstar: true }, ), - true + true, ); t.equal( match( "http://foo.com/*/*/jquery.min.js", "http://foo.com/bar/baz/jquery.min.js", - { globstar: false } + { globstar: false }, ), - true + true, ); t.equal( match( "http://foo.com/*/jquery.min.js", "http://foo.com/bar/baz/jquery.min.js", - { globstar: false } + { globstar: false }, ), - true + true, ); t.equal( match( "http://foo.com/*/jquery.min.js", "http://foo.com/bar/baz/jquery.min.js", - { globstar: true } + { globstar: true }, ), - false + false, ); }, }); @@ -646,46 +646,46 @@ Deno.test({ t.equal(match("?(foo|bar)baz.txt", "foobaz.txt", { extended: true }), true); t.equal( match("?(ba[zr]|qux)baz.txt", "bazbaz.txt", { extended: true }), - true + true, ); t.equal( match("?(ba[zr]|qux)baz.txt", "barbaz.txt", { extended: true }), - true + true, ); t.equal( match("?(ba[zr]|qux)baz.txt", "quxbaz.txt", { extended: true }), - true + true, ); t.equal( match("?(ba[!zr]|qux)baz.txt", "batbaz.txt", { extended: true }), - true + true, ); t.equal(match("?(ba*|qux)baz.txt", "batbaz.txt", { extended: true }), true); t.equal( match("?(ba*|qux)baz.txt", "batttbaz.txt", { extended: true }), - true + true, ); t.equal(match("?(ba*|qux)baz.txt", "quxbaz.txt", { extended: true }), true); t.equal( match("?(ba?(z|r)|qux)baz.txt", "bazbaz.txt", { extended: true }), - true + true, ); t.equal( match("?(ba?(z|?(r))|qux)baz.txt", "bazbaz.txt", { extended: true }), - true + true, ); t.equal(match("?(foo).txt", "foo.txt", { extended: false }), false); t.equal( match("?(foo|bar)baz.txt", "foobarbaz.txt", { extended: true }), - false + false, ); t.equal( match("?(ba[zr]|qux)baz.txt", "bazquxbaz.txt", { extended: true }), - false + false, ); t.equal( match("?(ba[!zr]|qux)baz.txt", "bazbaz.txt", { extended: true }), - false + false, ); }, }); @@ -708,21 +708,21 @@ Deno.test({ t.equal(match("*(foo|b*[rt]).txt", "tlat.txt", { extended: true }), false); t.equal( match("*(*).txt", "whatever.txt", { extended: true, globstar: true }), - true + true, ); t.equal( match("*(foo|bar)/**/*.txt", "foo/hello/world/bar.txt", { extended: true, globstar: true, }), - true + true, ); t.equal( match("*(foo|bar)/**/*.txt", "foo/world/bar.txt", { extended: true, globstar: true, }), - true + true, ); }, }); @@ -745,15 +745,15 @@ Deno.test({ t.equal(match("@(foo|baz)bar.txt", "foobar.txt", { extended: true }), true); t.equal( match("@(foo|baz)bar.txt", "foobazbar.txt", { extended: true }), - false + false, ); t.equal( match("@(foo|baz)bar.txt", "foofoobar.txt", { extended: true }), - false + false, ); t.equal( match("@(foo|baz)bar.txt", "toofoobar.txt", { extended: true }), - false + false, ); }, }); @@ -766,11 +766,11 @@ Deno.test({ t.equal(match("!bar.txt", "!bar.txt", { extended: true }), true); t.equal( match("!({foo,bar})baz.txt", "notbaz.txt", { extended: true }), - true + true, ); t.equal( match("!({foo,bar})baz.txt", "foobaz.txt", { extended: true }), - false + false, ); }, }); @@ -791,35 +791,35 @@ Deno.test({ match("**/*/?yfile.{md,js,txt}", "foo/bar/baz/myfile.md", { extended: true, }), - true + true, ); t.equal( match("**/*/?yfile.{md,js,txt}", "foo/baz/myfile.md", { extended: true }), - true + true, ); t.equal( match("**/*/?yfile.{md,js,txt}", "foo/baz/tyfile.js", { extended: true }), - true + true, ); t.equal( match("[[:digit:]_.]/file.js", "1/file.js", { extended: true }), - true + true, ); t.equal( match("[[:digit:]_.]/file.js", "2/file.js", { extended: true }), - true + true, ); t.equal( match("[[:digit:]_.]/file.js", "_/file.js", { extended: true }), - true + true, ); t.equal( match("[[:digit:]_.]/file.js", "./file.js", { extended: true }), - true + true, ); t.equal( match("[[:digit:]_.]/file.js", "z/file.js", { extended: true }), - false + false, ); }, }); |