Skip to content

Commit

Permalink
cmd/archive: also test for non-existence of file named - (#3800)
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre authored Jun 19, 2024
1 parent 4481771 commit 8efec40
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, "%q should not exist", filename)
}

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

0 comments on commit 8efec40

Please sign in to comment.