aboutsummaryrefslogtreecommitdiff
path: root/test/test_view.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_view.ml')
-rw-r--r--test/test_view.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/test_view.ml b/test/test_view.ml
index b2d302e..a542419 100644
--- a/test/test_view.ml
+++ b/test/test_view.ml
@@ -292,6 +292,25 @@ let test_vocabularies_localise () =
Alcotest.(check string) "rite_name" "Missale Romanum, editio typica 1962"
(as_str (get [ "rite_name" ] v))
+(* A month answers to BOTH spellings of its own name. The week objects nested
+ inside a month expose [month_name]/[month_num]/[month_abbr], so an author
+ who learned those names there reaches for them one level up too -- and an
+ unknown key renders as the EMPTY STRING by design, so the mistake produced
+ a silently blank heading rather than any error. Found by writing a template
+ from scratch; the shipped ones all sidestep it. *)
+let test_month_answers_to_both_spellings () =
+ let v = view_named 2027 in
+ let jan = List.hd (as_list (get [ "months" ] v)) in
+ let same a b =
+ Alcotest.(check string) (a ^ " = " ^ b) (as_str (get [ a ] jan))
+ (as_str (get [ b ] jan))
+ in
+ same "name" "month_name";
+ same "num" "month_num";
+ Alcotest.(check string) "month_name" "Ianuarius" (as_str (get [ "month_name" ] jan));
+ Alcotest.(check bool) "month_abbr is present and non-empty" true
+ (as_str (get [ "month_abbr" ] jan) <> "")
+
let suite =
( "View",
[ Alcotest.test_case "year shape" `Quick test_year_shape;