Fix builded ghc-mod's path for cabal-sandbox environment
This commit is contained in:
parent
d8275263f0
commit
9469058d58
@ -1,9 +1,12 @@
|
||||
module InfoSpec where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
import Data.List (isPrefixOf)
|
||||
import Language.Haskell.GhcMod
|
||||
import Language.Haskell.GhcMod.Cradle
|
||||
import System.Environment (getExecutablePath)
|
||||
import System.Exit
|
||||
import System.FilePath
|
||||
import System.Process
|
||||
import Test.Hspec
|
||||
|
||||
@ -50,5 +53,9 @@ spec = do
|
||||
res `shouldSatisfy` ("bar :: [Char]" `isPrefixOf`)
|
||||
|
||||
it "doesn't fail on unicode output" $ do
|
||||
code <- rawSystem "dist/build/ghc-mod/ghc-mod" ["info", "test/data/Unicode.hs", "Unicode", "unicode"]
|
||||
dir <- getDistDir
|
||||
code <- rawSystem (dir </> "build/ghc-mod/ghc-mod") ["info", "test/data/Unicode.hs", "Unicode", "unicode"]
|
||||
code `shouldSatisfy` (== ExitSuccess)
|
||||
|
||||
getDistDir :: IO FilePath
|
||||
getDistDir = takeDirectory . takeDirectory . takeDirectory <$> getExecutablePath
|
||||
|
Loading…
Reference in New Issue
Block a user