From 6d78c65c58820f79ec5a978a9476d29969da218f Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 27 Jul 2026 12:58:31 +0200 Subject: feat(cli): 'lectio --liturgy/-L' prints the computed liturgical day offline Uses the pure engine + embedded universal calendar; UI-language names, rank, colour, cycles, and inline proper readings. Added the Assumption's propers. --- internal/cli/liturgy_test.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 internal/cli/liturgy_test.go (limited to 'internal/cli/liturgy_test.go') diff --git a/internal/cli/liturgy_test.go b/internal/cli/liturgy_test.go new file mode 100644 index 0000000..c3ab0b4 --- /dev/null +++ b/internal/cli/liturgy_test.go @@ -0,0 +1,33 @@ +package cli + +import ( + "bytes" + "path/filepath" + "strings" + "testing" + + "github.com/lukaszkasprzak/lectio/internal/config" +) + +func TestRunLiturgy(t *testing.T) { + dir := t.TempDir() + t.Setenv("LECTIO_CONFIG", filepath.Join(dir, "config.ini")) + cfg, err := config.Load() + if err != nil { + t.Fatal(err) + } + var buf bytes.Buffer + if code := runLiturgy(cfg, "2025-08-15", &buf, &buf); code != 0 { + t.Fatalf("exit code %d", code) + } + out := buf.String() + if !strings.Contains(out, "2025-08-15") { + t.Errorf("missing date:\n%s", out) + } + if !strings.Contains(strings.ToLower(out), "solemnity") || !strings.Contains(out, "Assumption") { + t.Errorf("2025-08-15 should be the Assumption solemnity:\n%s", out) + } + if !strings.Contains(out, "gospel:") { + t.Errorf("proper reading not shown:\n%s", out) + } +} -- cgit v1.3