Skip to content

Commit

Permalink
cmd/archive: also test for non-existence of file named -
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed Jun 19, 2024
1 parent 154177f commit e3d567c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,10 @@ func TestArchiveStdout(t *testing.T) {

newRootCommand(ts.GlobalState).execute()

_, err := ts.FS.Stat("archive.tar")
require.ErrorIs(t, err, fs.ErrNotExist)
for _, filename := range []string{"-", "archive.tar"} {
_, err := ts.FS.Stat(filename)
require.ErrorIsf(t, err, fs.ErrNotExist, "%s should not exist", filename)
}

require.GreaterOrEqual(t, len(ts.Stdout.Bytes()), 32)
}

0 comments on commit e3d567c

Please sign in to comment.