From db6d26031f3cfb43a05e8dd99c984ffe01490054 Mon Sep 17 00:00:00 2001 From: Bob Matcuk Date: Sun, 30 Oct 2022 20:34:10 -0400 Subject: [PATCH] fix windows tests --- doublestar_test.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doublestar_test.go b/doublestar_test.go index f2af100..0d441d2 100644 --- a/doublestar_test.go +++ b/doublestar_test.go @@ -38,13 +38,13 @@ var matchTests = []MatchTest{ {"a*", "a", true, nil, false, true, true, 9, 9}, {"a*", "abc", true, nil, false, true, true, 9, 9}, {"a*", "ab/c", false, nil, false, true, true, 9, 9}, - {"a*/b", "abc/b", true, nil, true, true, true, 2, 2}, - {"a*/b", "a/c/b", false, nil, true, true, true, 2, 2}, + {"a*/b", "abc/b", true, nil, !onWindows, true, true, 2, 2}, + {"a*/b", "a/c/b", false, nil, !onWindows, true, true, 2, 2}, {"a*b*c*d*e*", "axbxcxdxe", true, nil, false, true, true, 3, 3}, - {"a*b*c*d*e*/f", "axbxcxdxe/f", true, nil, true, true, true, 2, 2}, - {"a*b*c*d*e*/f", "axbxcxdxexxx/f", true, nil, true, true, true, 2, 2}, - {"a*b*c*d*e*/f", "axbxcxdxe/xxx/f", false, nil, true, true, true, 2, 2}, - {"a*b*c*d*e*/f", "axbxcxdxexxx/fff", false, nil, true, true, true, 2, 2}, + {"a*b*c*d*e*/f", "axbxcxdxe/f", true, nil, !onWindows, true, true, 2, 2}, + {"a*b*c*d*e*/f", "axbxcxdxexxx/f", true, nil, !onWindows, true, true, 2, 2}, + {"a*b*c*d*e*/f", "axbxcxdxe/xxx/f", false, nil, !onWindows, true, true, 2, 2}, + {"a*b*c*d*e*/f", "axbxcxdxexxx/fff", false, nil, !onWindows, true, true, 2, 2}, {"a*b?c*x", "abxbbxdbxebxczzx", true, nil, false, true, true, 2, 2}, {"a*b?c*x", "abxbbxdbxebxczzy", false, nil, false, true, true, 2, 2}, {"ab[c]", "abc", true, nil, false, true, true, 1, 1}, @@ -99,12 +99,12 @@ var matchTests = []MatchTest{ {"a/**", "a/", true, nil, false, false, false, 7, 7}, {"a/**", "a/b", true, nil, false, false, true, 7, 7}, {"a/**", "a/b/c", true, nil, false, false, true, 7, 7}, - {"**/c", "c", true, nil, true, false, true, 5, 4}, - {"**/c", "b/c", true, nil, true, false, true, 5, 4}, - {"**/c", "a/b/c", true, nil, true, false, true, 5, 4}, - {"**/c", "a/b", false, nil, true, false, true, 5, 4}, - {"**/c", "abcd", false, nil, true, false, true, 5, 4}, - {"**/c", "a/abc", false, nil, true, false, true, 5, 4}, + {"**/c", "c", true, nil, !onWindows, false, true, 5, 4}, + {"**/c", "b/c", true, nil, !onWindows, false, true, 5, 4}, + {"**/c", "a/b/c", true, nil, !onWindows, false, true, 5, 4}, + {"**/c", "a/b", false, nil, !onWindows, false, true, 5, 4}, + {"**/c", "abcd", false, nil, !onWindows, false, true, 5, 4}, + {"**/c", "a/abc", false, nil, !onWindows, false, true, 5, 4}, {"a/**/b", "a/b", true, nil, false, false, true, 2, 2}, {"a/**/c", "a/b/c", true, nil, false, false, true, 2, 2}, {"a/**/d", "a/b/c/d", true, nil, false, false, true, 1, 1}, @@ -131,10 +131,10 @@ var matchTests = []MatchTest{ {"{a/abc}", "a/abc", true, nil, false, false, true, 1, 1}, {"{a/b,a/c}", "a/c", true, nil, false, false, true, 2, 2}, {"abc/**", "abc/b", true, nil, false, false, true, 3, 3}, - {"**/abc", "abc", true, nil, true, false, true, 2, 2}, + {"**/abc", "abc", true, nil, !onWindows, false, true, 2, 2}, {"abc**", "abc/b", false, nil, false, false, true, 3, 3}, - {"**/*.txt", "abc/【test】.txt", true, nil, true, false, true, 1, 1}, - {"**/【*", "abc/【test】.txt", true, nil, true, false, true, 1, 1}, + {"**/*.txt", "abc/【test】.txt", true, nil, !onWindows, false, true, 1, 1}, + {"**/【*", "abc/【test】.txt", true, nil, !onWindows, false, true, 1, 1}, {"**/{a,b}", "a/b", true, nil, true, false, true, 5, 5}, // unfortunately, io/fs can't handle this, so neither can Glob =( {"broken-symlink", "broken-symlink", true, nil, false, true, false, 1, 1},