@@ -9,7 +9,7 @@ import qualified UnliftIO.Exception as UE
99import Effectful.Interpreter
1010import Effectful.State.Dynamic
1111import Effectful.Monad
12−import Utils
12+import qualified Utils as U
1313
1414stateTests :: TestTree
1515stateTests = testGroup "State"
@@ -24,19 +24,19 @@ stateTests = testGroup "State"
2424test_runState :: Assertion
2525test_runState = runIOE $ do
2626 (end, len) <- runState (0::Int) . execState collatzStart $ collatz
27− assertEqual_ "correct end" 1 end
28− assertEqual_ "correct len" collatzLength len
27+ U.assertEqual "correct end" 1 end
28+ U.assertEqual "correct len" collatzLength len
2929
3030test_evalState :: Assertion
3131test_evalState = runIOE $ do
3232 len <- evalState (0::Int) . evalState collatzStart $ collatz *> get @Int
33− assertEqual_ "correct len" collatzLength len
33+ U.assertEqual "correct len" collatzLength len
3434
3535test_stateM :: Assertion
3636test_stateM = runIOE $ do
3737 (a, b) <- runState "hi" . stateM $ \s -> pure (s, s ++ "!!!")
38− assertEqual_ "correct a" "hi" a
39− assertEqual_ "correct b" "hi!!!" b
38+ U.assertEqual "correct a" "hi" a
39+ U.assertEqual "correct b" "hi!!!" b
4040
4141test_deepStack :: Assertion
4242test_deepStack = runIOE $ do
@@ -48,7 +48,7 @@ test_deepStack = runIOE $ do
4848 modify @Int (+2)
4949 modify @Int (+4)
5050 modify @Int (+8)
51− assertEqual_ "n" 15 n
51+ U.assertEqual "n" 15 n
5252
5353test_exceptions :: Assertion
5454test_exceptions = runIOE $ do
@@ -61,28 +61,28 @@ test_exceptions = runIOE $ do
6161 where
6262 testTry
6363 :: String
64− -> (forall a es. IOE :> es => Eff es a -> Eff es (Either Ex a))
64+ -> (forall a es. IOE :> es => Eff es a -> Eff es (Either U.Ex a))
6565 -> Eff '[IOE] ()
6666 testTry lib tryImpl = do
6767 e <- tryImpl $ runState (0::Int) action
68− assertEqual_ (lib ++ " - exception caught") e (Left Ex)
68+ U.assertEqual (lib ++ " - exception caught") e (Left U.Ex)
6969 s <- execState (0::Int) $ tryImpl action
70− assertEqual_ (lib ++ " - state partially updated") s 1
70+ U.assertEqual (lib ++ " - state partially updated") s 1
7171
7272 testCatch
7373 :: String
74− -> (forall a es. IOE :> es => Eff es a -> (Ex -> Eff es a) -> Eff es a)
74+ -> (forall a es. IOE :> es => Eff es a -> (U.Ex -> Eff es a) -> Eff es a)
7575 -> Eff '[IOE] ()
7676 testCatch lib catchImpl = do
7777 s <- execState (0::Int) $ do
78− _ <- (evalState () action) `catchImpl` \Ex -> modify @Int (+4)
78+ _ <- (evalState () action) `catchImpl` \U.Ex -> modify @Int (+4)
7979 modify @Int (+8)
80− assertEqual_ (lib ++ " - state correctly updated") s 13
80+ U.assertEqual (lib ++ " - state correctly updated") s 13
8181
8282 action :: State Int :> es => Eff es ()
8383 action = do
8484 modify @Int (+1)
85− _ <- E.throwM Ex
85+ _ <- E.throwM U.Ex
8686 modify @Int (+2)
8787
8888test_localEffects :: Assertion
@@ -94,7 +94,7 @@ test_localEffects = runIOE $ do
9494 execState () $ do
9595 putInt expected
9696 getInt
97− assertEqual_ "correct x" expected x
97+ U.assertEqual "correct x" expected x
9898 where
9999 expected :: Int
100100 expected = 4