review request (more regular output)
This commit is contained in:
parent
4ca9a0243b
commit
a30d59121f
@ -966,12 +966,12 @@ let%expect_test _ =
|
|||||||
let%expect_test _ =
|
let%expect_test _ =
|
||||||
run_ligo_good [ "run-function" ; contract "failwith.ligo" ; "failer" ; "1" ] ;
|
run_ligo_good [ "run-function" ; contract "failwith.ligo" ; "failer" ; "1" ] ;
|
||||||
[%expect {|
|
[%expect {|
|
||||||
failed with string some_string |}]
|
failwith("some_string") |}]
|
||||||
|
|
||||||
let%expect_test _ =
|
let%expect_test _ =
|
||||||
run_ligo_good [ "run-function" ; contract "failwith.ligo" ; "failer" ; "1" ; "--format=json" ] ;
|
run_ligo_good [ "run-function" ; contract "failwith.ligo" ; "failer" ; "1" ; "--format=json" ] ;
|
||||||
[%expect {|
|
[%expect {|
|
||||||
{"status":"ok","content":"failed with string some_string"} |}]
|
{"status":"ok","content":"failwith(\"some_string\")"} |}]
|
||||||
|
|
||||||
let%expect_test _ =
|
let%expect_test _ =
|
||||||
run_ligo_bad [ "compile-contract" ; contract "bad_address_format.religo" ; "main" ] ;
|
run_ligo_bad [ "compile-contract" ; contract "bad_address_format.religo" ; "main" ] ;
|
||||||
@ -1022,5 +1022,5 @@ let%expect_test _ =
|
|||||||
(* TODO should not be bad? *)
|
(* TODO should not be bad? *)
|
||||||
run_ligo_good [ "dry-run" ; contract "subtle_nontail_fail.mligo" ; "main" ; "()" ; "()" ] ;
|
run_ligo_good [ "dry-run" ; contract "subtle_nontail_fail.mligo" ; "main" ; "()" ; "()" ] ;
|
||||||
[%expect {|
|
[%expect {|
|
||||||
failed with string This contract always fails |}]
|
failwith("This contract always fails") |}]
|
||||||
|
|
||||||
|
@ -38,11 +38,10 @@ type dry_run_options =
|
|||||||
let failwith_to_string (f:run_failwith_res) : string result =
|
let failwith_to_string (f:run_failwith_res) : string result =
|
||||||
let%bind str = match f with
|
let%bind str = match f with
|
||||||
| Failwith_int i -> ok @@ string_of_int i
|
| Failwith_int i -> ok @@ string_of_int i
|
||||||
| Failwith_string s -> ok @@ s
|
| Failwith_string s -> ok @@ Format.asprintf "\"%s\"" (String.escaped s)
|
||||||
| Failwith_bytes b ->
|
| Failwith_bytes b ->
|
||||||
generic_try (simple_error "Could not convert failwith bytes to string") @@
|
ok @@ Format.asprintf "0X%a" Hex.pp (Hex.of_bytes b) in
|
||||||
(fun () -> Bytes.to_string b) in
|
ok @@ Format.asprintf "failwith(%s)" str
|
||||||
ok @@ Format.asprintf "failed with value '%s'" str
|
|
||||||
|
|
||||||
let make_dry_run_options (opts : dry_run_options) : options result =
|
let make_dry_run_options (opts : dry_run_options) : options result =
|
||||||
let open Proto_alpha_utils.Trace in
|
let open Proto_alpha_utils.Trace in
|
||||||
|
Loading…
Reference in New Issue
Block a user