@@ -9,26 +9,24 @@ main = defaultTestRunner $ testGroup "haskell-language-server-wrapper" [projectG
99
1010projectGhcVersionTests :: TestTree
1111projectGhcVersionTests = 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" $
1815 -- Use system-ghc and install-ghc to avoid stack downloading ghc in CI
1916 -- (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
2319 , testCase " cabal with global ghc" $ do
24- ghcVer <- trimEnd <$> readProcess " ghc " [ " --numeric-version " ] " "
20+ ghcVer <- ghcNumericVersion
2521 testDir (pure () ) " test/wrapper/testdata/cabal-cur-ver" ghcVer
2622 , testCase " stack with existing cabal build artifact" $ do
2723 -- Should report cabal as existing build artifacts are more important than
2824 -- the existence of 'stack.yaml'
2925 testProjectType " test/wrapper/testdata/stack-with-dist-newstyle"
3026 (" cradleOptsProg = CradleAction: Cabal" `isInfixOf` )
3127 ]
28+ where
29+ ghcNumericVersion = trimEnd <$> readProcess " ghc" [" --numeric-version" ] " "
3230
3331testDir :: IO () -> FilePath -> String -> Assertion
3432testDir extraSetup dir expectedVer =
0 commit comments