Fix util.RootStar.

This commit is contained in:
Qi Xiao 2016-02-23 03:02:23 +01:00
parent 3b5510f80e
commit c67ad408ee
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ func RootStar() []string {
var newnames []string
for _, name := range names {
if name[0] != '/' {
if name[0] != '.' {
newnames = append(newnames, "/"+name)
}
}

View File

@ -8,7 +8,7 @@ import (
"testing"
)
func TestRootNames(t *testing.T) {
func TestRootStar(t *testing.T) {
// NOTE: will fail if there are newlines in /*.
want, err := exec.Command("ls", "/").Output()
mustOK(err)
@ -23,6 +23,6 @@ func TestRootNames(t *testing.T) {
sort.Strings(names)
if !reflect.DeepEqual(names, wantNames) {
t.Errorf("RootNames() -> %s, want %s", names, wantNames)
t.Errorf("RootStar() -> %s, want %s", names, wantNames)
}
}