From dbf215a35b81e65915b2a2142ad17ba19cf6081c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 8 Sep 2015 06:42:32 +0200 Subject: [PATCH] Fix tests, this time, this time for sure. --- Language/Haskell/GhcMod/Utils.hs | 3 +-- test/CabalHelperSpec.hs | 1 - test/PathsAndFilesSpec.hs | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Language/Haskell/GhcMod/Utils.hs b/Language/Haskell/GhcMod/Utils.hs index 236f608..99d4190 100644 --- a/Language/Haskell/GhcMod/Utils.hs +++ b/Language/Haskell/GhcMod/Utils.hs @@ -216,6 +216,5 @@ findFilesWith' f (d:ds) fileName = do makeAbsolute' :: FilePath -> IO FilePath makeAbsolute' = (normalise <$>) . absolutize where absolutize path -- avoid the call to `getCurrentDirectory` if we can - | isRelative path = ( path) . addTrailingPathSeparator <$> - getCurrentDirectory + | isRelative path = ( path) <$> getCurrentDirectory | otherwise = return path diff --git a/test/CabalHelperSpec.hs b/test/CabalHelperSpec.hs index 162675e..30bcfb0 100644 --- a/test/CabalHelperSpec.hs +++ b/test/CabalHelperSpec.hs @@ -9,7 +9,6 @@ import Language.Haskell.GhcMod.Error import Test.Hspec import System.Directory import System.FilePath -import System.Process (readProcess, system) import Prelude import Dir diff --git a/test/PathsAndFilesSpec.hs b/test/PathsAndFilesSpec.hs index ec3057b..b2ac6e6 100644 --- a/test/PathsAndFilesSpec.hs +++ b/test/PathsAndFilesSpec.hs @@ -35,13 +35,14 @@ spec = do describe "findStackConfigFile" $ do it "works" $ do - findStackConfigFile "test/data/stack-project" `shouldReturn` Just "test/data/stack-project/stack.yaml" + p <- U.makeAbsolute' "test/data/stack-project/stack.yaml" + findStackConfigFile "test/data/stack-project" `shouldReturn` Just p describe "findCabalSandboxDir" $ do it "works" $ do - p <- U.makeAbsolute' "test/data/cabal-project/cabalapi.cabal" + p <- U.makeAbsolute' "test/data/cabal-project" findCabalSandboxDir "test/data/cabal-project" `shouldReturn` Just p it "finds sandboxes in parent directories" $ do - p <- U.makeAbsolute' "test/data/cabal-project/" + p <- U.makeAbsolute' "test/data/cabal-project" findCabalSandboxDir "test/data/cabal-project/subdir1/subdir2" `shouldReturn` Just p