我試圖測試一個小函數(或更確切地說,IO操作),它接受一個命令行參數並將其輸出到屏幕。我原來(不可測)函數是: -- In Library.hs
module Library where
import System.Environment (getArgs)
run :: IO()
run = do
args <- getArgs
putStrLn $ head a
期間重複實例聲明是什麼時候cabal install testpack-2.1.1失敗以下錯誤消息意味着: ... Everything above this succeeded with no problems.
[22 of 22] Compiling Control.Monad.Cont (Control/Monad/Cont.hs, dist/build/Control/Monad/Co
我正在爲函數eval :: Wff -> Assignment -> Maybe Bool寫一個HUnit測試。 Wff是自定義數據類型是用於布爾表達式的簡化子集的抽象語法分析樹: data Wff = Var Name
| Not Wff
| Or Wff Wff
deriving (Eq)
和Assignment是一個關聯列表中的類型別名,其給出了一個W
我現在有下面的測試代碼: testUpdate :: Test
testUpdate = testCase "update does change artist" $ do
(created, Just revised, parents) <- mbTest $ do
Just editor <- fmap entityRef <$> findEditorByName "ac