mirror of
https://github.com/bsima/haskell-urbit-api.git
synced 2024-08-17 14:00:31 +03:00
test: exit 1 on failure
This commit is contained in:
parent
f5ff159d8e
commit
0da4659782
5
test.hs
5
test.hs
@ -20,6 +20,7 @@ import qualified Network.Wreq as Wreq
|
||||
import qualified Network.Wreq.Session as Session
|
||||
import qualified Numeric
|
||||
import qualified System.Environment as Env
|
||||
import qualified System.Exit as Exit
|
||||
import qualified System.Random as Random
|
||||
import Urbit.Airlock
|
||||
|
||||
@ -79,9 +80,9 @@ testing description f =
|
||||
(putStrLn $ replicate 80 '-') >> try f >>= \case
|
||||
Left (err :: SomeException) -> do
|
||||
Text.IO.putStrLn $ "FAIL: " <> description
|
||||
putStrLn $ show err
|
||||
Exit.die $ show err
|
||||
Right False -> do
|
||||
Text.IO.putStrLn $ "FAIL: " <> description
|
||||
putStrLn $ "expected True, got False"
|
||||
Exit.die "expected True, got False"
|
||||
Right True ->
|
||||
Text.IO.putStrLn $ "PASS: " <> description
|
||||
|
Loading…
Reference in New Issue
Block a user