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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
module Expect_test_config = struct
include Expect_test_config
let upon_unreleasable_issue = `Warning_for_collector_testing
end
module M (S : sig
val output : string
end) =
struct
let%expect_test _ =
print_string S.output;
[%expect
{|
(* expect_test: Test ran multiple times with different test outputs *)
============================ Output 1 / 3 ============================
foo
============================ Output 2 / 3 ============================
bar
============================ Output 3 / 3 ============================
cat
|}];
print_string S.output;
[%expect
{|
(* expect_test: Test ran multiple times with different trailing outputs *)
============================== Output 1 / 3 ==============================
foo
============================== Output 2 / 3 ==============================
bar
============================== Output 3 / 3 ==============================
cat
|}]
;;
let%expect_test _ =
print_string S.output;
if not (String.equal S.output "foo") then failwith "wrong output";
[%expect {| foo |}]
[@@expect.uncaught_exn
{|
(* expect_test: Test ran multiple times with different uncaught exceptions *)
=============================== Output 1 / 3 ================================
<expect test ran without uncaught exception>
=============================== Output 2 / 3 ================================
(Failure "wrong output")
Trailing output
---------------
bar
=============================== Output 3 / 3 ================================
(Failure "wrong output")
Trailing output
---------------
cat
|}]
;;
let%expect_test _ =
if String.equal S.output "bar" then print_string S.output else failwith "wrong output";
[%expect {| bar |}]
[@@expect.uncaught_exn
{|
(* expect_test: Test ran multiple times with different uncaught exceptions *)
=============================== Output 1 / 3 ================================
(Failure "wrong output")
=============================== Output 2 / 3 ================================
<expect test ran without uncaught exception>
=============================== Output 3 / 3 ================================
(Failure "wrong output")
|}]
;;
end
module A = M (struct
let output = "foo"
end)
module B = M (struct
let output = "bar"
end)
module C = M (struct
let output = "cat"
end)
|