mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
24 lines
424 B
Go
24 lines
424 B
Go
package util
|
|
|
|
import (
|
|
"reflect"
|
|
"runtime"
|
|
"testing"
|
|
)
|
|
|
|
func TestFullNames(t *testing.T) {
|
|
var dirs []string
|
|
if runtime.GOOS == "windows" {
|
|
dirs = []string{`C:\`, `C:\Users\`}
|
|
} else {
|
|
dirs = []string{"/", "/usr"}
|
|
}
|
|
for _, dir := range dirs {
|
|
wantNames := ls(dir)
|
|
names := FullNames(dir)
|
|
if !reflect.DeepEqual(names, wantNames) {
|
|
t.Errorf(`FullNames(%q) -> %s, want %s`, dir, names, wantNames)
|
|
}
|
|
}
|
|
}
|