From 872e4c607453c74413bd63fc08cbc91cb0981db0 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 31 Jul 2026 14:10:44 +0200 Subject: cli: colitur easter prints Easter and its anchors Argv-parsed subcommand; validates the 1583..9999 domain (exit 2 otherwise); prints 'name YYYY-MM-DD' lines. Cram test covers the output and the exit codes. --- test/cli.t | 21 +++++++++++++++++++++ test/dune | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 test/cli.t (limited to 'test') diff --git a/test/cli.t b/test/cli.t new file mode 100644 index 0000000..319fc8c --- /dev/null +++ b/test/cli.t @@ -0,0 +1,21 @@ +Easter and its Easter-relative movable feasts for a year: + + $ colitur easter 2026 + easter 2026-04-05 + ash-wednesday 2026-02-18 + palm-sunday 2026-03-29 + ascension 2026-05-14 + pentecost 2026-05-24 + corpus-christi 2026-06-04 + +A year outside the supported domain is rejected (exit 2): + + $ colitur easter 1000 + colitur: year 1000 out of range 1583..9999 + [2] + +No/garbage arguments give a usage error (exit 2): + + $ colitur + colitur: usage: colitur easter + [2] diff --git a/test/dune b/test/dune index 3d8df19..8ee8b87 100644 --- a/test/dune +++ b/test/dune @@ -1,3 +1,6 @@ (test (name test_colitur) (libraries colitur_kernel alcotest qcheck qcheck-alcotest)) + +(cram + (deps %{bin:colitur})) -- cgit v1.3