[英]HUnit not importing on Mac
在為 Max OSX 全新安裝 Haskell 平台時,以下代碼在使用runghc
解釋器運行時import Test.HUnit
失敗。
{--
- 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)
然而,當使用 ghci 時,做一個簡單的import Test.HUnit
就可以了。
如何解決命令行中的ghc
和ghci
REPL 之間的這種差異?
重新啟動機器。 不確定它的路徑是否不包含正確的目錄或其他內容,但安裝后重新開始似乎已經解決了它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.