diff options
Diffstat (limited to 'test/test_citation.ml')
| -rw-r--r-- | test/test_citation.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/test_citation.ml b/test/test_citation.ml index dae4610..3cbc8c6 100644 --- a/test/test_citation.ml +++ b/test/test_citation.ml @@ -267,10 +267,11 @@ module P = Colitur_citation.Parse (* Render a parse back to a debug string so a test can assert shape compactly: "book|chapter:v-v,v-v|chapter:v". *) let show (t : P.t) = + let num (v : P.verse_num) = string_of_int v.P.n ^ v.P.suffix in let range (r : P.verse_range) = match r.P.last with - | None -> string_of_int r.P.first - | Some l -> Printf.sprintf "%d-%d" r.P.first l + | None -> num r.P.first + | Some l -> Printf.sprintf "%s-%s" (num r.P.first) (num l) in let part (p : P.part) = Printf.sprintf "%d:%s" p.P.chapter @@ -396,7 +397,9 @@ let test_subst_unknown_placeholder_alone () = the assertion isolates exactly the numeral and nothing else. *) let roman_of n = let luke = match B.of_token "Luke" with Some id -> id | None -> assert false in - let t : P.t = { P.book = luke; parts = [ { P.chapter = n; verses = [ { P.first = 1; last = None } ] } ] } in + let t : P.t = + { P.book = luke; parts = [ { P.chapter = n; verses = [ { P.first = { P.n = 1; suffix = "" }; last = None } ] } ] } + in let style = R.style_of_fields [ ("book_sep", ""); ("chapter_verse", "{chapter_roman}") ] in R.render style ~names:(fun _ _ -> "") t |
