Skip to content

Commit

Permalink
Update utils_test.go to allow running in read-only mode.
Browse files Browse the repository at this point in the history
Restrict `os.OpenFile` to use just read flag, which allows to pass tests on the
systems like Guix with isolated read-only environment.
  • Loading branch information
Hellseher authored Jun 7, 2024
1 parent 7eaf97a commit d6aee84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestUtilFuncs(t *testing.T) {
is.True(IsConsole(os.Stdout))
is.True(IsConsole(os.Stderr))
is.False(IsConsole(&bytes.Buffer{}))
ff, err := os.OpenFile("README.md", os.O_WRONLY, 0)
ff, err := os.OpenFile("README.md", os.O_RDONLY, 0)
is.NoError(err)
is.False(IsConsole(ff))

Expand Down

0 comments on commit d6aee84

Please sign in to comment.