@@ -9,26 +9,24 @@ main = defaultTestRunner $ testGroup "haskell-language-server-wrapper" [projectG
9
9
10
10
projectGhcVersionTests :: TestTree
11
11
projectGhcVersionTests = testGroup " --project-ghc-version"
12
- [ let ghcVer = case ghcVersion of
13
- GHC92 -> " 9.2.8"
14
- GHC94 -> " 9.4.8"
15
- GHC96 -> " 9.6.4"
16
- GHC98 -> " 9.8.1"
17
- writeStackYaml = writeFile " stack.yaml"
12
+ [ testCase " stack with global ghc" $ do
13
+ ghcVer <- ghcNumericVersion
14
+ let writeStackYaml = writeFile " stack.yaml" $
18
15
-- Use system-ghc and install-ghc to avoid stack downloading ghc in CI
19
16
-- (and use ghcup-managed ghc instead)
20
- (" {resolver: ghc-" ++ ghcVer ++ " , system-ghc: true, install-ghc: false}" )
21
- in testCase (" stack with ghc " ++ ghcVer) $
22
- testDir writeStackYaml " test/wrapper/testdata/stack-specific-ghc" ghcVer
17
+ " {resolver: ghc-" ++ ghcVer ++ " , system-ghc: true, install-ghc: false}"
18
+ testDir writeStackYaml " test/wrapper/testdata/stack-specific-ghc" ghcVer
23
19
, testCase " cabal with global ghc" $ do
24
- ghcVer <- trimEnd <$> readProcess " ghc " [ " --numeric-version " ] " "
20
+ ghcVer <- ghcNumericVersion
25
21
testDir (pure () ) " test/wrapper/testdata/cabal-cur-ver" ghcVer
26
22
, testCase " stack with existing cabal build artifact" $ do
27
23
-- Should report cabal as existing build artifacts are more important than
28
24
-- the existence of 'stack.yaml'
29
25
testProjectType " test/wrapper/testdata/stack-with-dist-newstyle"
30
26
(" cradleOptsProg = CradleAction: Cabal" `isInfixOf` )
31
27
]
28
+ where
29
+ ghcNumericVersion = trimEnd <$> readProcess " ghc" [" --numeric-version" ] " "
32
30
33
31
testDir :: IO () -> FilePath -> String -> Assertion
34
32
testDir extraSetup dir expectedVer =
0 commit comments