Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Commit

Permalink
Fix tests, this time, this time for sure.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielG committed Sep 8, 2015
1 parent 7ae22a9 commit dbf215a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Language/Haskell/GhcMod/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion test/CabalHelperSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions test/PathsAndFilesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dbf215a

Please sign in to comment.