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
|
module InfoSpec where
|
||||||
|
|
||||||
|
import Control.Applicative ((<$>))
|
||||||
import Data.List (isPrefixOf)
|
import Data.List (isPrefixOf)
|
||||||
import Language.Haskell.GhcMod
|
import Language.Haskell.GhcMod
|
||||||
import Language.Haskell.GhcMod.Cradle
|
import Language.Haskell.GhcMod.Cradle
|
||||||
|
import System.Environment (getExecutablePath)
|
||||||
import System.Exit
|
import System.Exit
|
||||||
|
import System.FilePath
|
||||||
import System.Process
|
import System.Process
|
||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
|
|
||||||
@ -50,5 +53,9 @@ spec = do
|
|||||||
res `shouldSatisfy` ("bar :: [Char]" `isPrefixOf`)
|
res `shouldSatisfy` ("bar :: [Char]" `isPrefixOf`)
|
||||||
|
|
||||||
it "doesn't fail on unicode output" $ do
|
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)
|
code `shouldSatisfy` (== ExitSuccess)
|
||||||
|
|
||||||
|
getDistDir :: IO FilePath
|
||||||
|
getDistDir = takeDirectory . takeDirectory . takeDirectory <$> getExecutablePath
|
||||||
|
Loading…
Reference in New Issue
Block a user