On a fresh install of Haskell Platform for Max OSX, the foll开发者_StackOverflow社区owing code fails on import Test.HUnit
when run using the runghc
interpreter.
{--
- Save this file as Main.hs and run with % runghc Main.hs
-}
module Main where
import Test.HUnit
derp = test [ "a silly test" ~: 'a' ~=? 'a' ]
tests = TestList [ derp ]
main::IO()
main = (runTestTT tests) >>= (\x -> putStrLn $ show x)
However, when using ghci, doing a simple import Test.HUnit
works just fine.
How can I resolve this discrepancy between ghc
from the command line and the ghci
REPL?
Reboot the machine. Not sure whether it's paths not containing the right directories or something else, but a fresh start after install seems to have resolved it.
精彩评论