This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
19
unikernel/duniverse/base/test/test_printexc.ml
Normal file
19
unikernel/duniverse/base/test/test_printexc.ml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
open! Import
|
||||
module Printexc = Stdlib.Printexc
|
||||
|
||||
let%expect_test "Printexc: built-in exception" =
|
||||
print_endline (Printexc.to_string (Invalid_argument "bad"));
|
||||
[%expect {| Invalid_argument("bad") |}]
|
||||
;;
|
||||
|
||||
let%expect_test "Sexp conversion of built-in exceptions" =
|
||||
print_endline (Sexp.to_string (sexp_of_exn (Invalid_argument "bad")));
|
||||
[%expect {| (Invalid_argument bad) |}]
|
||||
;;
|
||||
|
||||
exception My_invalid_argument of string [@@deriving sexp]
|
||||
|
||||
let%expect_test "Printexc: an exception with deriving sexp" =
|
||||
print_endline (Printexc.to_string (My_invalid_argument "bad"));
|
||||
[%expect {| (test_printexc.ml.My_invalid_argument bad) |}]
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue