From 06364d29dcaf8eb266c43f385c9f1242868476a4 Mon Sep 17 00:00:00 2001 From: Ro Santalla Date: Tue, 18 Jun 2024 19:19:50 +0200 Subject: [PATCH] cmd/archive: also test for non-existence of file named `-` --- cmd/archive_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/archive_test.go b/cmd/archive_test.go index 16bdf9e7c4ae..5d9d7acb4e61 100644 --- a/cmd/archive_test.go +++ b/cmd/archive_test.go @@ -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.ErrorIs(t, err, fs.ErrNotExist) + } require.GreaterOrEqual(t, len(ts.Stdout.Bytes()), 32) }