Skip to content

Commit 72ce169

Browse files
committed
stat.Name() should return basename conventionally for recursive walking
1 parent 309d824 commit 72ce169

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/fs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"bytes"
1919
"io/ioutil"
2020
"os"
21+
"path"
2122
"path/filepath"
2223
"reflect"
2324
"strings"
@@ -155,7 +156,7 @@ func TestOpen(t *testing.T) {
155156
if got, want := stat.Mode(), wantFile.mode; got != want {
156157
t.Errorf("Mode(%v) = %v; want %v", name, got, want)
157158
}
158-
if got, want := stat.Name(), wantFile.name; got != want {
159+
if got, want := stat.Name(), path.Base(wantFile.name); got != want {
159160
t.Errorf("Name(%v) = %v; want %v", name, got, want)
160161
}
161162
if got, want := stat.Size(), wantFile.size; got != want {

0 commit comments

Comments
 (0)