4 | import Evince.Expectations
8 | tryApp : App (err :: Init) a -> IO (Either err a)
9 | tryApp act = run $
handle act (\ok => pure (Right ok)) (\e => pure (Left e))
13 | mustError : Show err => App (err :: Init) a -> IO (TestResult ())
15 | result <- tryApp act
17 | Left _ => pure (Pass ())
18 | Right _ => pure (Fail (Reason "expected error but succeeded"))
22 | mustErrorWith : (Show err, DecEq err) => App (err :: Init) a -> err -> IO (TestResult ())
23 | mustErrorWith act expected = do
24 | result <- tryApp act
26 | Left e => pure (e `mustBe` expected)
27 | Right _ => pure (Fail (Reason "expected error but succeeded"))