This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
14
unikernel/duniverse/ppxlib/test/location/exception/dune
Normal file
14
unikernel/duniverse/ppxlib/test/location/exception/dune
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(rule
|
||||
(package ppxlib)
|
||||
(alias runtest)
|
||||
(enabled_if
|
||||
(>= %{ocaml_version} "4.08.0"))
|
||||
(deps
|
||||
(:test test.ml)
|
||||
(package ppxlib))
|
||||
(action
|
||||
(chdir
|
||||
%{project_root}
|
||||
(progn
|
||||
(run expect-test %{test})
|
||||
(diff? %{test} %{test}.corrected)))))
|
||||
17
unikernel/duniverse/ppxlib/test/location/exception/test.ml
Normal file
17
unikernel/duniverse/ppxlib/test/location/exception/test.ml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
open Ppxlib.Location
|
||||
|
||||
let catch_as_compiler_exception =
|
||||
try raise_errorf ~loc:none "foo" with
|
||||
| Ocaml_common.Location.Error _ -> "caught"
|
||||
| _ -> "uncaught"
|
||||
[%%expect{|
|
||||
val catch_as_compiler_exception : string = "caught"
|
||||
|}]
|
||||
|
||||
let catch_as_ppxlib_exception =
|
||||
try raise_errorf ~loc:none "foo" with
|
||||
| Error _ -> "caught"
|
||||
| _ -> "uncaught"
|
||||
[%%expect{|
|
||||
val catch_as_ppxlib_exception : string = "caught"
|
||||
|}]
|
||||
Loading…
Add table
Add a link
Reference in a new issue