aboutsummaryrefslogtreecommitdiff
path: root/internal/config/config_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 13:20:28 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 13:20:28 +0200
commitaaa1c702124a6f0044b458482b349dc725816674 (patch)
tree78bd166c4dea5778c6951613f3105c06f1f80ffd /internal/config/config_test.go
parentacbba6b53df93de694abf1feb90ab401fd6a4580 (diff)
downloadlectio-aaa1c702124a6f0044b458482b349dc725816674.tar.gz
lectio-aaa1c702124a6f0044b458482b349dc725816674.zip
feat(config): 'use' layer stack + CalendarsDir()
Diffstat (limited to 'internal/config/config_test.go')
-rw-r--r--internal/config/config_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 38c7604..e3af475 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -239,6 +239,27 @@ func TestSelectionFromINI(t *testing.T) {
}
}
+func TestUseLayers(t *testing.T) {
+ dir := t.TempDir()
+ t.Setenv("LECTIO_CONFIG", filepath.Join(dir, "config.ini"))
+ os.WriteFile(filepath.Join(dir, "config.ini"), []byte("use = poland, krakow\n"), 0o644)
+ cfg, err := Load()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(cfg.Use) != 2 || cfg.Use[0] != "poland" || cfg.Use[1] != "krakow" {
+ t.Fatalf("Use = %v", cfg.Use)
+ }
+ // round-trips through Save
+ if err := Save(cfg); err != nil {
+ t.Fatal(err)
+ }
+ got, _ := Load()
+ if len(got.Use) != 2 || got.Use[1] != "krakow" {
+ t.Errorf("Use after round-trip = %v", got.Use)
+ }
+}
+
func TestMigrateTOMLToINI(t *testing.T) {
dir := t.TempDir()
t.Setenv("XDG_CONFIG_HOME", dir)