Commit c616f1ea authored by Seb Mondet's avatar Seb Mondet
Browse files

Improve Liquidity “failwith checking”

parent 6459b69b
......@@ -202,10 +202,12 @@ module On_chain = struct
match should with
| `Fail -> return (`Expected `Failure)
| `Fail_with_re re ->
if
List.exists res#err ~f:(fun line ->
String.is_prefix line ~prefix:"with " && Re.execp re line )
then return (`Expected `Failure)
let intersting_part =
List.drop_while res#err ~f:(fun line ->
String.is_prefix line ~prefix:"script reached FAILWITH" )
|> String.concat ~sep:" "
in
if Re.execp re intersting_part then return (`Expected `Failure)
else return (`Failed `With_error_does_not_match)
| `Be_ok -> return (`Failed `Not_ok) )
| true when should = `Be_ok ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment