This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
28
unikernel/duniverse/base/test/test_error.ml
Normal file
28
unikernel/duniverse/base/test/test_error.ml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
open! Base
|
||||
open! Import
|
||||
|
||||
let errors =
|
||||
[ Error.of_string "ABC"
|
||||
; Error.tag ~tag:"DEF" (Error.of_thunk (fun () -> "GHI"))
|
||||
; Error.create_s [%message "foo" ~bar:(31 : int)]
|
||||
]
|
||||
;;
|
||||
|
||||
let%expect_test _ =
|
||||
List.iter errors ~f:(fun error -> show_raise (fun () -> Error.raise error));
|
||||
[%expect {|
|
||||
(raised ABC)
|
||||
(raised (DEF GHI))
|
||||
(raised (foo (bar 31)))
|
||||
|}]
|
||||
;;
|
||||
|
||||
let%expect_test _ =
|
||||
List.iter errors ~f:(fun error ->
|
||||
show_raise (fun () -> Error.raise_s [%sexp (error : Error.t)]));
|
||||
[%expect {|
|
||||
(raised ABC)
|
||||
(raised (DEF GHI))
|
||||
(raised (foo (bar 31)))
|
||||
|}]
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue