Fix tests, this time, this time for sure.
This commit is contained in:
parent
7ae22a9226
commit
dbf215a35b
@ -216,6 +216,5 @@ findFilesWith' f (d:ds) fileName = do
|
|||||||
makeAbsolute' :: FilePath -> IO FilePath
|
makeAbsolute' :: FilePath -> IO FilePath
|
||||||
makeAbsolute' = (normalise <$>) . absolutize
|
makeAbsolute' = (normalise <$>) . absolutize
|
||||||
where absolutize path -- avoid the call to `getCurrentDirectory` if we can
|
where absolutize path -- avoid the call to `getCurrentDirectory` if we can
|
||||||
| isRelative path = (</> path) . addTrailingPathSeparator <$>
|
| isRelative path = (</> path) <$> getCurrentDirectory
|
||||||
getCurrentDirectory
|
|
||||||
| otherwise = return path
|
| otherwise = return path
|
||||||
|
@ -9,7 +9,6 @@ import Language.Haskell.GhcMod.Error
|
|||||||
import Test.Hspec
|
import Test.Hspec
|
||||||
import System.Directory
|
import System.Directory
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import System.Process (readProcess, system)
|
|
||||||
import Prelude
|
import Prelude
|
||||||
|
|
||||||
import Dir
|
import Dir
|
||||||
|
@ -35,13 +35,14 @@ spec = do
|
|||||||
|
|
||||||
describe "findStackConfigFile" $ do
|
describe "findStackConfigFile" $ do
|
||||||
it "works" $ 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
|
describe "findCabalSandboxDir" $ do
|
||||||
it "works" $ 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
|
findCabalSandboxDir "test/data/cabal-project" `shouldReturn` Just p
|
||||||
|
|
||||||
it "finds sandboxes in parent directories" $ do
|
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
|
findCabalSandboxDir "test/data/cabal-project/subdir1/subdir2" `shouldReturn` Just p
|
||||||
|
Loading…
Reference in New Issue
Block a user