How can I assert that a contract transfer fails with a particular error message? Tried a couple things, including this:
match call_as pledger1 Get_refund 1tz taddr with | Success _ -> assert_with_error false "unexpected success" | Fail (Rejected ("you must wait longer before finalizing the withdraw", _)) -> () | Fail err -> let () = Test.log err in assert_with_error false "unexpected error"
Here's the error message I got:
File "./test.mligo", line 51, characters 22-75: 50 | | Success _ -> assert_with_error false "success" 51 | | Fail (Rejected ("you must wait longer before finalizing the withdraw", _)) -> 52 | assert_with_error false "woot" Invalid pattern matching. If this is pattern matching over Booleans, then "true" or "false" is expected. If this is pattern matching on a list, then one of the following is expected: * an empty list pattern ""; * a cons list pattern "[head, ...tail]". If this is pattern matching over variants, then a constructor of a variant is expected. Other forms of pattern matching are not (yet) supported.