}
slices.Sort(want)
- if strings.Join(want, "/") != strings.Join(have, "/") {
+ if !slices.Equal(want, have) {
t.Fatalf("unexpected interface list %q, want %q", have, want)
}
}
want = append(want, wantIPv6...)
slices.Sort(want)
- if strings.Join(want, "/") != strings.Join(have, "/") {
+ if !slices.Equal(want, have) {
t.Errorf("%s: unexpected addresses list %q, want %q", ifi.Name, have, want)
}
}
}
slices.Sort(have)
- if strings.Join(want, "/") != strings.Join(have, "/") {
+ if !slices.Equal(want, have) {
t.Fatalf("unexpected file list %q, want %q", have, want)
}
}
}
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)
}
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)
// Check results
slices.Sort(files)
slices.Sort(files2)
- if strings.Join(files, "|") != strings.Join(files2, "|") {
+ if !slices.Equal(files, files2) {
t.Errorf("bad file list: want\n%q\ngot\n%q", files, files2)
}
}
"os"
"path/filepath"
"slices"
- "strings"
"syscall"
"testing"
"unsafe"
names = append(names, ".", "..") // Getdirentries returns these also
slices.Sort(names)
slices.Sort(names2)
- if strings.Join(names, ":") != strings.Join(names2, ":") {
+ if !slices.Equal(names, names2) {
t.Errorf("names don't match\n names: %q\nnames2: %q", names, names2)
}
}