summaryrefslogtreecommitdiff
path: root/internal/processor/processor_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-08-02 15:54:18 +0300
committerPaul Buetow <paul@buetow.org>2025-08-02 15:54:18 +0300
commitf8574d5ecf31021b1aee7fcb0c8b45c190bffead (patch)
tree77ee9a55771d496f1338017f4402f2c91f5f59e5 /internal/processor/processor_test.go
parent0968c9e0df98580d628f06f7afe1764fd857fb17 (diff)
add timestamps to .apkg exports and num of cardsv0.7.5
Diffstat (limited to 'internal/processor/processor_test.go')
-rw-r--r--internal/processor/processor_test.go17
1 files changed, 12 insertions, 5 deletions
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
}