diff options
Diffstat (limited to 'internal/syscallcompat/getdents_test.go')
-rw-r--r-- | internal/syscallcompat/getdents_test.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/internal/syscallcompat/getdents_test.go b/internal/syscallcompat/getdents_test.go index cb95b7c..a6f41ca 100644 --- a/internal/syscallcompat/getdents_test.go +++ b/internal/syscallcompat/getdents_test.go @@ -83,7 +83,7 @@ func testGetdents(t *testing.T) { if err != nil { t.Fatal(err) } - getdentsEntries, err := getdentsUnderTest(int(fd.Fd())) + getdentsEntries, special, err := getdentsUnderTest(int(fd.Fd())) if err != nil { t.Log(err) skipOnGccGo(t) @@ -114,5 +114,20 @@ func testGetdents(t *testing.T) { } } } + if len(special) != 2 { + t.Error(special) + } + if !(special[0].Name == "." && special[1].Name == ".." || + special[1].Name == "." && special[0].Name == "..") { + t.Error(special) + } + for _, v := range special { + if v.Ino == 0 { + t.Error(v) + } + if v.Mode != syscall.S_IFDIR { + t.Error(v) + } + } } } |