Skip to content

Commit

Permalink
Parametrize stack wrapper test
Browse files Browse the repository at this point in the history
  • Loading branch information
jneira committed Dec 10, 2021
1 parent 85823ef commit 2b9d59f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/wrapper/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 =
Expand Down

0 comments on commit 2b9d59f

Please sign in to comment.