开发者

HUnit not importing on Mac

开发者 https://www.devze.com 2023-03-21 15:33 出处:网络
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.

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

精彩评论

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

关注公众号