elvish/util/fullnames_test.go

24 lines
424 B
Go
Raw Normal View History

2016-10-13 17:02:42 +08:00
package util
import (
"reflect"
"runtime"
2016-10-13 17:02:42 +08:00
"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 {
2016-10-13 17:02:42 +08:00
wantNames := ls(dir)
names := FullNames(dir)
if !reflect.DeepEqual(names, wantNames) {
t.Errorf(`FullNames(%q) -> %s, want %s`, dir, names, wantNames)
}
}
}