elvish/util/fullnames_test.go
2017-12-06 17:59:55 +01:00

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)
}
}
}