aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-31 14:10:44 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-31 14:10:44 +0200
commit872e4c607453c74413bd63fc08cbc91cb0981db0 (patch)
tree4ecc9e8f84c4eec96943141abe9afa67b6ebc08d /test
parent58deef45d6039d78bc423554f630d27f6bec1bb3 (diff)
downloadcolitur-872e4c607453c74413bd63fc08cbc91cb0981db0.tar.gz
colitur-872e4c607453c74413bd63fc08cbc91cb0981db0.zip
cli: colitur easter <year> 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.
Diffstat (limited to 'test')
-rw-r--r--test/cli.t21
-rw-r--r--test/dune3
2 files changed, 24 insertions, 0 deletions
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 <year>
+ [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}))