开发者

HUnit not importing on Mac

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜