summaryrefslogtreecommitdiff
path: root/test/test_temporal_ef.ml
blob: f7851c16e4e78e546069fcacc333cd3d3b42daea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module V = Rite_ef.Vocab_ef

let test_vocab_roundtrips () =
  List.iter
    (fun s ->
      Alcotest.(check bool) "season string roundtrip" true
        (V.season_of_string (V.season_to_string s) = Some s))
    V.seasons;
  List.iter
    (fun r ->
      Alcotest.(check bool) "rank string roundtrip" true
        (V.rank_of_string (V.rank_to_string r) = Some r))
    V.ranks;
  Alcotest.(check int) "eight seasons" 8 (List.length V.seasons);
  Alcotest.(check int) "four ranks" 4 (List.length V.ranks)

(* Slug words are lectio's lectionary-key vocabulary, deliberately distinct from
   the season names (spec §4.4, plan correction 2). *)
let test_slug_words () =
  Alcotest.(check string) "paschaltide slugs as easter" "easter" (V.season_slug_word V.Paschaltide);
  Alcotest.(check string) "christmastide slugs as christmas" "christmas"
    (V.season_slug_word V.Christmastide);
  Alcotest.(check string) "season name differs" "paschaltide" (V.season_to_string V.Paschaltide)

let suite =
  ( "Rite_ef",
    [ Alcotest.test_case "vocab roundtrips" `Quick test_vocab_roundtrips;
      Alcotest.test_case "slug words" `Quick test_slug_words ] )