From 175eee360017df32bb4a821aac16a3b1fa6d3633 Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Sat, 21 Sep 2019 14:42:07 -0400 Subject: [PATCH] crueler --- pkging/pkgtest/file.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkging/pkgtest/file.go b/pkging/pkgtest/file.go index 313160b..52d82fc 100644 --- a/pkging/pkgtest/file.go +++ b/pkging/pkgtest/file.go @@ -86,6 +86,20 @@ func (s Suite) Test_File_Readdir(t *testing.T) { r.Equal("images", infos[0].Name()) r.Equal("index.html", infos[1].Name()) + + dir, err = pkg.Open(tt.in + "/images") + r.NoError(err) + + infos, err = dir.Readdir(-1) + r.NoError(err) + r.Len(infos, 1) + + sort.Slice(infos, func(i, j int) bool { + return infos[i].Name() < infos[j].Name() + }) + + r.Equal("mark.png", infos[0].Name()) + }) } }