aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath
diff options
context:
space:
mode:
Diffstat (limited to 'src/path/filepath')
-rw-r--r--src/path/filepath/match_test.go3
-rw-r--r--src/path/filepath/path_test.go6
-rw-r--r--src/path/filepath/path_windows_test.go4
3 files changed, 6 insertions, 7 deletions
diff --git a/src/path/filepath/match_test.go b/src/path/filepath/match_test.go
index c6b1c50520..3cee92f8ae 100644
--- a/src/path/filepath/match_test.go
+++ b/src/path/filepath/match_test.go
@@ -9,7 +9,6 @@ import (
"internal/testenv"
"os"
. "path/filepath"
- "reflect"
"runtime"
"slices"
"strings"
@@ -367,7 +366,7 @@ func TestNonWindowsGlobEscape(t *testing.T) {
if err != nil {
t.Fatalf("Glob error for %q: %s", pattern, err)
}
- if !reflect.DeepEqual(matches, want) {
+ if !slices.Equal(matches, want) {
t.Fatalf("Glob(%#q) = %v want %v", pattern, matches, want)
}
}
diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go
index b24f39c5aa..5d3cbc991f 100644
--- a/src/path/filepath/path_test.go
+++ b/src/path/filepath/path_test.go
@@ -364,7 +364,7 @@ func TestSplitList(t *testing.T) {
tests = append(tests, winsplitlisttests...)
}
for _, test := range tests {
- if l := filepath.SplitList(test.list); !reflect.DeepEqual(l, test.result) {
+ if l := filepath.SplitList(test.list); !slices.Equal(l, test.result) {
t.Errorf("SplitList(%#q) = %#q, want %#q", test.list, l, test.result)
}
}
@@ -1004,7 +1004,7 @@ func TestWalkSymlinkRoot(t *testing.T) {
t.Fatal(err)
}
- if !reflect.DeepEqual(walked, tt.want) {
+ if !slices.Equal(walked, tt.want) {
t.Logf("Walk(%#q) visited %#q; want %#q", tt.root, walked, tt.want)
if slices.Contains(tt.buggyGOOS, runtime.GOOS) {
t.Logf("(ignoring known bug on %v)", runtime.GOOS)
@@ -1950,7 +1950,7 @@ func TestIssue51617(t *testing.T) {
t.Fatal(err)
}
want := []string{".", "a", filepath.Join("a", "bad"), filepath.Join("a", "next")}
- if !reflect.DeepEqual(saw, want) {
+ if !slices.Equal(saw, want) {
t.Errorf("got directories %v, want %v", saw, want)
}
}
diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go
index 2862f390d0..603b179405 100644
--- a/src/path/filepath/path_windows_test.go
+++ b/src/path/filepath/path_windows_test.go
@@ -13,8 +13,8 @@ import (
"os"
"os/exec"
"path/filepath"
- "reflect"
"runtime/debug"
+ "slices"
"strings"
"testing"
)
@@ -83,7 +83,7 @@ func testWinSplitListTestIsValid(t *testing.T, ti int, tt SplitListTest,
case err != nil:
t.Errorf("%d,%d: execution error %v\n%q", ti, i, err, out)
return
- case !reflect.DeepEqual(out, exp):
+ case !slices.Equal(out, exp):
t.Errorf("%d,%d: expected %#q, got %#q", ti, i, exp, out)
return
default: