Skip to content

Commit a722d70

Browse files
author
Armaël Guéneau
committed
Add a test doing a roundtrip add_dummy_locs -> erase_locs
1 parent c15c941 commit a722d70

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib_test/test_mustache.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ let tests = [
8989

9090
]
9191

92+
let roundtrip : t -> t =
93+
fun t -> erase_locs (add_dummy_locs t)
94+
9295
let () =
9396

9497
let assert_equal ?(printer=fun _ -> "") a b =
@@ -99,7 +102,9 @@ let () =
99102
(List.mapi
100103
(fun i (input, expected_parsing, rendering_tests) ->
101104
let template = Mustache.of_string input in
102-
(Printf.sprintf "%d - parsing" i
105+
(Printf.sprintf "%d - erase_locs/add_dummy_locs roundtrip" i
106+
>:: assert_equal (roundtrip template) template)
107+
:: (Printf.sprintf "%d - parsing" i
103108
>:: assert_equal expected_parsing template)
104109
:: List.mapi (fun j (data, expected) ->
105110
(Printf.sprintf "%d - rendering (%d)" i j)

0 commit comments

Comments
 (0)