From f8574d5ecf31021b1aee7fcb0c8b45c190bffead Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Aug 2025 15:54:18 +0300 Subject: add timestamps to .apkg exports and num of cards --- internal/processor/processor_test.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'internal/processor/processor_test.go') diff --git a/internal/processor/processor_test.go b/internal/processor/processor_test.go index 40f5cbe..2c8eaa6 100644 --- a/internal/processor/processor_test.go +++ b/internal/processor/processor_test.go @@ -252,11 +252,18 @@ func TestGenerateAnkiFile_APKG(t *testing.T) { t.Errorf("GenerateAnkiFile (APKG) failed: %v", err) } - // Check APKG file was created in home directory + // Check that an .apkg file was created in the home directory homeDir, _ := os.UserHomeDir() - apkgFile := filepath.Join(homeDir, "Test_Deck.apkg") - if _, err := os.Stat(apkgFile); os.IsNotExist(err) { - t.Error("APKG file was not created in home directory") + files, err := filepath.Glob(filepath.Join(homeDir, "*.apkg")) + if err != nil { + t.Fatalf("Error finding apkg file: %v", err) + } + if len(files) == 0 { + t.Fatal("No .apkg file found in home directory") + } + + // Clean up the created file + for _, file := range files { + os.Remove(file) } - os.Remove(apkgFile) // Clean up } -- cgit v1.2.3