diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Main.hs | 6 | ||||
-rw-r--r-- | tests/common/TestsSetup.hs | 4 |
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" [] |