Skip to content

Commit

Permalink
unit-tests: fix hlint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Mar 9, 2016
1 parent b279f19 commit 8dfd0a9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions unit-tests/run-unit-tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Prelude hiding ( catch )
import Control.Exception.Extensible ( ArithException(..) )
import Control.Monad.Catch as MC

import Control.Monad ( liftM, when )
import Control.Monad ( liftM, when, void )

import Control.Concurrent ( forkIO )
import Control.Concurrent.MVar
Expand Down Expand Up @@ -45,8 +45,7 @@ test_reload_modified = TestCase "reload_modified" [mod_file] $ do
--
get_f = do loadModules [mod_file]
setTopLevelModules [mod_name]
r <- interpret "f" (as :: Int -> Int)
return r
interpret "f" (as :: Int -> Int)

test_lang_exts :: TestCase
test_lang_exts = TestCase "lang_exts" [mod_file] $ do
Expand Down Expand Up @@ -114,9 +113,9 @@ test_basic_eval = TestCase "basic_eval" [] $ do
test_eval_layout :: TestCase
test_eval_layout = TestCase "eval_layout" [] $ do
eval layout_expr @@?= "10"
where layout_expr = unlines $ ["let x = let y = 10",
" in y",
"in x"]
where layout_expr = unlines ["let x = let y = 10",
" in y",
"in x"]

test_show_in_scope :: TestCase
test_show_in_scope = TestCase "show_in_scope" [] $ do
Expand Down Expand Up @@ -206,7 +205,7 @@ test_only_one_instance = TestCase "only_one_instance" [] $ do
`catch` \MultipleInstancesNotAllowed ->
do liftIO $ putMVar r True
return $ Right ()
_ <- forkIO $ concurrent >> return ()
_ <- forkIO $ Control.Monad.void concurrent
readMVar r @? "concurrent instance did not fail"


Expand Down Expand Up @@ -242,7 +241,7 @@ main = do -- run the tests...
-- `catch` (\_ -> exitWith (ExitFailure $ -1))

printInterpreterError :: InterpreterError -> IO ()
printInterpreterError = hPutStrLn stderr . show
printInterpreterError = hPrint stderr

setSandbox :: Interpreter ()
setSandbox = set [installedModulesInScope := False]
Expand Down

0 comments on commit 8dfd0a9

Please sign in to comment.