1
1
import Data.List.Extra (isInfixOf , trimEnd )
2
2
import Data.Maybe
3
- import System.Directory
4
3
import System.Environment
5
4
import System.Process
6
5
import Test.Hls
@@ -29,12 +28,6 @@ testDir dir expectedVer =
29
28
withCurrentDirectoryInTmp dir $ do
30
29
testExe <- fromMaybe " haskell-language-server-wrapper"
31
30
<$> lookupEnv " HLS_WRAPPER_TEST_EXE"
32
- assertExecutableExists testExe
33
- cwd <- getCurrentDirectory
34
- putStrLn cwd
35
- print =<< listDirectory cwd
36
- print =<< readFile (cwd ++ " /stack.yaml" )
37
- print =<< readProcess " stack" [" --stack-yaml" , cwd ++ " /stack.yaml" , " setup" ] " "
38
31
actualVer <- trimEnd <$> readProcess testExe [" --project-ghc-version" ] " "
39
32
actualVer @?= expectedVer
40
33
@@ -43,18 +36,9 @@ testProjectType dir matcher =
43
36
withCurrentDirectoryInTmp' [" .stack-work" , " dist" ] dir $ do
44
37
wrapperTestExe <- fromMaybe " haskell-language-server-wrapper"
45
38
<$> lookupEnv " HLS_WRAPPER_TEST_EXE"
46
- assertExecutableExists wrapperTestExe
47
39
hlsTestExe <- fromMaybe " haskell-language-server"
48
40
<$> lookupEnv " HLS_TEST_EXE"
49
- assertExecutableExists hlsTestExe
50
41
actualWrapperCradle <- trimEnd <$> readProcess wrapperTestExe [" --print-cradle" ] " "
51
42
actualHlsCradle <- trimEnd <$> readProcess hlsTestExe [" --print-cradle" ] " "
52
43
matcher actualWrapperCradle @? " Wrapper reported wrong project type: " ++ actualWrapperCradle
53
44
matcher actualHlsCradle @? " HLS reported wrong project type: " ++ actualHlsCradle
54
-
55
- assertExecutableExists :: FilePath -> IO ()
56
- assertExecutableExists exe = do
57
- mbExe <- findExecutable exe
58
- case mbExe of
59
- Nothing -> assertFailure $ " Could not find executable " ++ exe
60
- Just path -> putStrLn $ " Found " ++ exe ++ " at " ++ path
0 commit comments