summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPhilFreeman <>2015-10-27 18:33:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-10-27 18:33:00 (GMT)
commitefedf67b2689ffe0d29ced3157f7ac7759b75700 (patch)
treed6fb1994255003f3381756835028a31b080b6242 /tests
parent02ef1718f713f0ba740b412d9c746a6528e315f0 (diff)
version 0.7.5.10.7.5.1
Diffstat (limited to 'tests')
-rw-r--r--tests/Main.hs6
-rw-r--r--tests/common/TestsSetup.hs4
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/Main.hs b/tests/Main.hs
index 6d202e1..eca7129 100644
--- a/tests/Main.hs
+++ b/tests/Main.hs
@@ -78,7 +78,7 @@ modulesDir :: FilePath
modulesDir = ".test_modules" </> "node_modules"
makeActions :: M.Map P.ModuleName FilePath -> P.MakeActions P.Make
-makeActions foreigns = (P.buildMakeActions modulesDir (error "makeActions: input file map was read.") foreigns False)
+makeActions foreigns = (P.buildMakeActions modulesDir (P.internalError "makeActions: input file map was read.") foreigns False)
{ P.getInputTimestamp = getInputTimestamp
, P.getOutputTimestamp = getOutputTimestamp
}
@@ -94,7 +94,7 @@ makeActions foreigns = (P.buildMakeActions modulesDir (error "makeActions: input
getOutputTimestamp mn = do
let filePath = modulesDir </> P.runModuleName mn
exists <- liftIO $ doesDirectoryExist filePath
- return (if exists then Just (error "getOutputTimestamp: read timestamp") else Nothing)
+ return (if exists then Just (P.internalError "getOutputTimestamp: read timestamp") else Nothing)
readInput :: [FilePath] -> IO [(FilePath, String)]
readInput inputFiles = forM inputFiles $ \inputFile -> do
@@ -104,7 +104,7 @@ readInput inputFiles = forM inputFiles $ \inputFile -> do
type TestM = WriterT [(FilePath, String)] IO
runTest :: P.Make a -> IO (Either P.MultipleErrors a)
-runTest = fmap (fmap fst) . P.runMake P.defaultOptions
+runTest = fmap fst . P.runMake P.defaultOptions
compile :: [FilePath] -> M.Map P.ModuleName FilePath -> IO (Either P.MultipleErrors P.Environment)
compile inputFiles foreigns = runTest $ do
diff --git a/tests/common/TestsSetup.hs b/tests/common/TestsSetup.hs
index cc853ec..2dc1458 100644
--- a/tests/common/TestsSetup.hs
+++ b/tests/common/TestsSetup.hs
@@ -28,6 +28,8 @@ import System.Process
import System.Directory
import System.Info
+import Language.PureScript.Crash
+
findNodeProcess :: IO (Maybe String)
findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
where
@@ -35,7 +37,7 @@ findNodeProcess = runMaybeT . msum $ map (MaybeT . findExecutable) names
fetchSupportCode :: IO ()
fetchSupportCode = do
- node <- fromMaybe (error "cannot find node executable") <$> findNodeProcess
+ node <- fromMaybe (internalError "cannot find node executable") <$> findNodeProcess
setCurrentDirectory "tests/support"
if System.Info.os == "mingw32"
then callProcess "setup-win.cmd" []