From 2b9d59f488e1f25cf9466f8e9e96f5433aac9413 Mon Sep 17 00:00:00 2001 From: jneira Date: Tue, 7 Dec 2021 14:10:53 +0100 Subject: [PATCH] Parametrize stack wrapper test --- test/wrapper/Main.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/wrapper/Main.hs b/test/wrapper/Main.hs index 979ceb2807..1e6f205a6d 100644 --- a/test/wrapper/Main.hs +++ b/test/wrapper/Main.hs @@ -11,10 +11,8 @@ main = do projectGhcVersionTests :: TestTree projectGhcVersionTests = testGroup "--project-ghc-version" - [ testCase "stack with ghc 8.10.7" $ - testDir "test/wrapper/testdata/stack-8.10.7" "8.10.7" - , testCase "stack with ghc 8.8.4" $ - testDir "test/wrapper/testdata/stack-8.8.4" "8.8.4" + [ stackTest "8.10.7" + , stackTest "8.8.4" , testCase "cabal with global ghc" $ do ghcVer <- trimEnd <$> readProcess "ghc" ["--numeric-version"] "" testDir "test/wrapper/testdata/cabal-cur-ver" ghcVer @@ -24,6 +22,9 @@ projectGhcVersionTests = testGroup "--project-ghc-version" testProjectType "test/wrapper/testdata/stack-with-dist-newstyle" ("cradleOptsProg = CradleAction: Cabal" `isInfixOf`) ] + where + stackTest ghcVer= testCase ("stack with ghc " ++ ghcVer) $ + testDir ("test/wrapper/testdata/stack-" ++ ghcVer) ghcVer testDir :: FilePath -> String -> Assertion testDir dir expectedVer =