fix: correct GetProperty bug, init to use .ax/, add default aliases, split e2e tests, add due date tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 01:58:48 +02:00
parent 5969a2591c
commit 921f4913f8
13 changed files with 1121 additions and 971 deletions

25
src/e2e_init_test.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"os"
"path/filepath"
"testing"
)
func TestInit(t *testing.T) {
t.Run("CreatesDatabase", func(t *testing.T) {
env := &testEnv{t: t, dir: t.TempDir(), user: "testuser"}
env.mustAx("init")
if _, err := os.Stat(filepath.Join(env.dir, ".ax", "ax.db")); err != nil {
t.Fatal(".ax/ax.db not created")
}
})
t.Run("FailsIfAlreadyExists", func(t *testing.T) {
env := newTestEnv(t, "testuser")
_, err := env.ax("init")
if err == nil {
t.Fatal("expected error re-initialising existing DB, got none")
}
})
}