File: test_sanitize.ml

package info (click to toggle)
ppx-expect 0.17.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: ml: 3,399; ansic: 104; javascript: 19; makefile: 15; sh: 2
file content (30 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (2)
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
29
30
let%expect_test "no sanitization" =
  print_endline "hi!";
  [%expect {| hi! |}]
;;

let%test_module _ =
  (module struct
    module Expect_test_config = struct
      include Expect_test_config

      let sanitize s = if s = "" then "" else "local module sanitize: " ^ s
    end

    let%expect_test "local sanitize" =
      print_endline "hi!";
      [%expect {| local module sanitize: hi! |}]
    ;;
  end)
;;

module Expect_test_config = struct
  include Expect_test_config

  let sanitize s = if s = "" then "" else "SANITIZED: " ^ s
end

let%expect_test "sanitize" =
  print_endline "hi!";
  [%expect {| SANITIZED: hi! |}]
;;