From 8fb05a33ffac3a80a050a36e18feb942439d86ee Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 27 Oct 2024 18:02:37 +0100 Subject: [PATCH] Update tempfile path in unit tests Changed tempfile creation path to "testdata/tmp" for better test organization and to ensure temporary files are stored within the testdata directory. This change affects the TestMsg_AttachFile_unixOnly tests. --- msg_nowin_test.go | 4 ++-- testdata/tmp/.gitkeep | 0 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 testdata/tmp/.gitkeep diff --git a/msg_nowin_test.go b/msg_nowin_test.go index 4875787..7aed2e7 100644 --- a/msg_nowin_test.go +++ b/msg_nowin_test.go @@ -18,7 +18,7 @@ import ( func TestMsg_AttachFile_unixOnly(t *testing.T) { t.Run("AttachFile with fileFromFS fails on open", func(t *testing.T) { - tempfile, err := os.CreateTemp("", "attachfile-unable-to-open.*.txt") + tempfile, err := os.CreateTemp("testdata/tmp", "attachfile-unable-to-open.*.txt") if err != nil { t.Fatalf("failed to create temp file: %s", err) } @@ -49,7 +49,7 @@ func TestMsg_AttachFile_unixOnly(t *testing.T) { } }) t.Run("AttachFile with fileFromFS fails on copy", func(t *testing.T) { - tempfile, err := os.CreateTemp("", "attachfile-close-early.*.txt") + tempfile, err := os.CreateTemp("testdata/tmp", "attachfile-close-early.*.txt") if err != nil { t.Fatalf("failed to create temp file: %s", err) } diff --git a/testdata/tmp/.gitkeep b/testdata/tmp/.gitkeep new file mode 100644 index 0000000..e69de29