Skip to content

Commit

Permalink
fix test cases on Windows
Browse files Browse the repository at this point in the history
on Windows f.Readdir returns no error if f is closed

Signed-off-by: Nicola Murino <[email protected]>
  • Loading branch information
drakkan committed Feb 17, 2024
1 parent 849f0bd commit e438c67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/common/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,12 @@ func TestListerAt(t *testing.T) {
err = lister.Close()
require.NoError(t, err)
n, err = lister.ListAt(files, 0)
require.Error(t, err)
require.NotErrorIs(t, err, io.EOF)
if runtime.GOOS == "windows" {
assert.NoError(t, err)
} else {
assert.Error(t, err)
assert.NotErrorIs(t, err, io.EOF)
}
require.Equal(t, 0, n)
lister, err = conn.ListDir("/")
require.NoError(t, err)
Expand Down

0 comments on commit e438c67

Please sign in to comment.