on master help sign in
Run Environment tests sequentially
78f0b4bAndrzej Rybczak
effectful/tests/EnvironmentTests.hs+11−6
@@ -9,12 +9,17 @@ import Effectful.Environment
9import qualified Utils as U
9import qualified Utils as U
10
10
11environmentTests :: TestTree
11environmentTests :: TestTree
12−environmentTests = testGroup "Environment"
12+environmentTests = testCaseSteps "Environment" $ \step -> do
13+ -- These tests need to be run sequentially because of
14+ -- https://github.com/arybczak/effectful/issues/39.
13− [ testCase "set and get an environment variable" test_setAndGet
15+ step "set and get an environment variable"
16+ test_setAndGet
14− , testCase "unset and try to get an environment variable" test_unsetAndGet
17+ step "unset and try to get an environment variable"
18+ test_unsetAndGet
15− , testCase "execute effects with custom arguments" test_withArgs
19+ step "execute effects with custom arguments"
20+ test_withArgs
16− , testCase "execute effects with custom program name" test_withProg
21+ step "execute effects with custom program name"
17− ]
22+ test_withProg
18
23
19test_setAndGet :: Assertion
24test_setAndGet :: Assertion
20test_setAndGet = runEff . runEnvironment $ do
25test_setAndGet = runEff . runEnvironment $ do
effectful/tests/Main.hs+2−1
@@ -4,6 +4,7 @@ import Test.Tasty
4
4
5import AsyncTests
5import AsyncTests
6import ConcurrencyTests
6import ConcurrencyTests
7+import EnvironmentTests
7import ErrorTests
8import ErrorTests
8import StateTests
9import StateTests
9import TimeoutTests
10import TimeoutTests
@@ -13,7 +14,7 @@ main :: IO ()
13main = defaultMain $ testGroup "effectful"
14main = defaultMain $ testGroup "effectful"
14 [ asyncTests
15 [ asyncTests
15 , concurrencyTests
16 , concurrencyTests
16− --, environmentTests -- FIXME: broken
17+ , environmentTests
17 , errorTests
18 , errorTests
18 , stateTests
19 , stateTests
19 , timeoutTests
20 , timeoutTests