Skip to content

Commit

Permalink
Add a test doing a roundtrip add_dummy_locs -> erase_locs
Browse files Browse the repository at this point in the history
  • Loading branch information
Armaël Guéneau committed Feb 25, 2017
1 parent c15c941 commit a722d70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib_test/test_mustache.ml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ let tests = [

]

let roundtrip : t -> t =
fun t -> erase_locs (add_dummy_locs t)

let () =

let assert_equal ?(printer=fun _ -> "") a b =
Expand All @@ -99,7 +102,9 @@ let () =
(List.mapi
(fun i (input, expected_parsing, rendering_tests) ->
let template = Mustache.of_string input in
(Printf.sprintf "%d - parsing" i
(Printf.sprintf "%d - erase_locs/add_dummy_locs roundtrip" i
>:: assert_equal (roundtrip template) template)
:: (Printf.sprintf "%d - parsing" i
>:: assert_equal expected_parsing template)
:: List.mapi (fun j (data, expected) ->
(Printf.sprintf "%d - rendering (%d)" i j)
Expand Down

0 comments on commit a722d70

Please sign in to comment.