test: exit 1 on failure

This commit is contained in:
Ben Sima 2020-10-12 11:58:34 -04:00
parent f5ff159d8e
commit 0da4659782

View File

@ -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