diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2025-07-25 13:02:01 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-08-11 08:13:16 -0700 |
| commit | a2431776ebc57ebc385d3fd9d3cc6eb89acb9d9c (patch) | |
| tree | ab5dfc3d560f01a14b7c824e05e45d7531e64479 /src/path | |
| parent | a7f05b38f7e7beefd5ee54089aae59b21507bb3c (diff) | |
| download | go-a2431776ebc57ebc385d3fd9d3cc6eb89acb9d9c.tar.xz | |
net, os, file/filepath, syscall: use slices.Equal in tests
Use slices.Equal to compare slices instead of strings.Join and then
comparing strings.
Change-Id: Ib916002b7357bd7f4e66b853dd7af8d98eba5549
Reviewed-on: https://go-review.googlesource.com/c/go/+/690475
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/path')
| -rw-r--r-- | src/path/filepath/match_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/path/filepath/match_test.go b/src/path/filepath/match_test.go index f415b04088..2ae79980c7 100644 --- a/src/path/filepath/match_test.go +++ b/src/path/filepath/match_test.go @@ -231,7 +231,7 @@ func (test *globTest) globAbs(root, rootPattern string) error { } slices.Sort(have) want := test.buildWant(root + `\`) - if strings.Join(want, "_") == strings.Join(have, "_") { + if slices.Equal(want, have) { return nil } return fmt.Errorf("Glob(%q) returns %q, but %q expected", p, have, want) @@ -245,12 +245,12 @@ func (test *globTest) globRel(root string) error { } slices.Sort(have) want := test.buildWant(root) - if strings.Join(want, "_") == strings.Join(have, "_") { + if slices.Equal(want, have) { return nil } // try also matching version without root prefix wantWithNoRoot := test.buildWant("") - if strings.Join(wantWithNoRoot, "_") == strings.Join(have, "_") { + if slices.Equal(wantWithNoRoot, have) { return nil } return fmt.Errorf("Glob(%q) returns %q, but %q expected", p, have, want) |
