Skip to content

Commit 2b9d59f

Browse files
committed
Parametrize stack wrapper test
1 parent 85823ef commit 2b9d59f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/wrapper/Main.hs

+5-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ main = do
1111

1212
projectGhcVersionTests :: TestTree
1313
projectGhcVersionTests = testGroup "--project-ghc-version"
14-
[ testCase "stack with ghc 8.10.7" $
15-
testDir "test/wrapper/testdata/stack-8.10.7" "8.10.7"
16-
, testCase "stack with ghc 8.8.4" $
17-
testDir "test/wrapper/testdata/stack-8.8.4" "8.8.4"
14+
[ stackTest "8.10.7"
15+
, stackTest "8.8.4"
1816
, testCase "cabal with global ghc" $ do
1917
ghcVer <- trimEnd <$> readProcess "ghc" ["--numeric-version"] ""
2018
testDir "test/wrapper/testdata/cabal-cur-ver" ghcVer
@@ -24,6 +22,9 @@ projectGhcVersionTests = testGroup "--project-ghc-version"
2422
testProjectType "test/wrapper/testdata/stack-with-dist-newstyle"
2523
("cradleOptsProg = CradleAction: Cabal" `isInfixOf`)
2624
]
25+
where
26+
stackTest ghcVer= testCase ("stack with ghc " ++ ghcVer) $
27+
testDir ("test/wrapper/testdata/stack-" ++ ghcVer) ghcVer
2728

2829
testDir :: FilePath -> String -> Assertion
2930
testDir dir expectedVer =

0 commit comments

Comments
 (0)