diff options
Diffstat (limited to 'tests/expression_repr.ml')
-rw-r--r-- | tests/expression_repr.ml | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/expression_repr.ml b/tests/expression_repr.ml index 9ad321a..20a0484 100644 --- a/tests/expression_repr.ml +++ b/tests/expression_repr.ml @@ -1,35 +1,34 @@ -open OUnit2 module Expression = ImportExpression.T module Path = ImportDataTypes.Path module Expr = Expression_builder module M = Expr.Make (ImportExpression.Repr.E) +open Test_migration let eval = M.eval ~path_repr:ImportCSV.Csv.column_to_string let test_expr expr = ImportExpression.Repr.E.observe ~top:true expr -let printer = function - | Ok e -> ImportConf.print_path_expression e - | Error msg -> msg +let assert_equal expected actual = + Alcotest.(check string) expected expected actual let print_literal = "print_litteral" >:: fun _ -> let result = test_expr @@ eval (Literal "Content") in - assert_equal ~printer:Fun.id "'Content'" result + assert_equal "'Content'" result let print_quoted_literal = "print_quoted_literal" >:: fun _ -> let result = test_expr @@ eval Expression_builder.literal_quoted in - assert_equal ~printer:Fun.id "'\\''" result + assert_equal "'\\''" result let print_dquoted_literal = "print_dquoted_literal" >:: fun _ -> let result = test_expr @@ eval (Literal "\"") in - assert_equal ~printer:Fun.id "'\"'" result + assert_equal "'\"'" result let print_numeric = "print_numeric" >:: fun _ -> let result = test_expr @@ eval (Literal "123") in - assert_equal ~printer:Fun.id "123" result + assert_equal "123" result let test_suit = [ print_literal; print_quoted_literal; print_dquoted_literal; print_numeric ] |