on master help sign in
Run Environment tests sequentially

Fixes #39.

commit78f0b4b7ebce8fc73d1790d2619905529a94392d authorAndrzej Rybczak <andrzej@rybczak.net> dateTue 14 Dec 2021, 23:50 (5 years ago) parentc65ede6
2 files changed+13−7
effectful/tests/EnvironmentTests.hs+11−6 effectful/tests/Main.hs+2−1
effectful/tests/EnvironmentTests.hs+11−6
@@ -9,12 +9,17 @@ import Effectful.Environment
99import qualified Utils as U
1010
1111environmentTests :: TestTree
12−environmentTests = testGroup "Environment"
13− [ testCase "set and get an environment variable" test_setAndGet
14− , testCase "unset and try to get an environment variable" test_unsetAndGet
15− , testCase "execute effects with custom arguments" test_withArgs
16− , testCase "execute effects with custom program name" test_withProg
17− ]
12+environmentTests = testCaseSteps "Environment" $ \step -> do
13+ -- These tests need to be run sequentially because of
14+ -- https://github.com/arybczak/effectful/issues/39.
15+ step "set and get an environment variable"
16+ test_setAndGet
17+ step "unset and try to get an environment variable"
18+ test_unsetAndGet
19+ step "execute effects with custom arguments"
20+ test_withArgs
21+ step "execute effects with custom program name"
22+ test_withProg
1823
1924test_setAndGet :: Assertion
2025test_setAndGet = runEff . runEnvironment $ do
effectful/tests/Main.hs+2−1
@@ -4,6 +4,7 @@ import Test.Tasty
44
55import AsyncTests
66import ConcurrencyTests
7+import EnvironmentTests
78import ErrorTests
89import StateTests
910import TimeoutTests
@@ -13,7 +14,7 @@ main :: IO ()
1314main = defaultMain $ testGroup "effectful"
1415 [ asyncTests
1516 , concurrencyTests
16− --, environmentTests -- FIXME: broken
17+ , environmentTests
1718 , errorTests
1819 , stateTests
1920 , timeoutTests