mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-04 10:57:50 +08:00
Fix util.RootStar.
This commit is contained in:
parent
3b5510f80e
commit
c67ad408ee
|
@ -20,7 +20,7 @@ func RootStar() []string {
|
|||
|
||||
var newnames []string
|
||||
for _, name := range names {
|
||||
if name[0] != '/' {
|
||||
if name[0] != '.' {
|
||||
newnames = append(newnames, "/"+name)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user