hunit

    0熱度

    2回答

    我可以編寫一個測試用例Test.HUnit來檢查一個調用是否引發異常? 我只關心它是否會拋出任何錯誤,無論它打印什麼信息。

    8熱度

    1回答

    如果我有test/Test.hs與 module Main where import Test.HUnit test1 :: Test test1 = TestCase $ assertEqual "Should be one" 1 5 test2 :: Test test2 = TestCase $ assertEqual "Shold both be zero" 0 0 m

    1熱度

    1回答

    同樣以快速檢查如何支持反例: property \x -> counterexample ("Foo failed with: " ++ ...) $ foo x 但在某種程度上,它的工作原理與shouldBe,例如 failDetails (" details: " ++ baz a) $ a `shouldBe` 2 ,我想它的線沿線的打印東西: expe

    1熱度

    1回答

    我遇到了奇怪的HUnit行爲。如果Nothing == Nothing條件存在於測試中,則不允許編譯測試用例。這裏是我的代碼再現這種行爲: module TestTest where import Control.Exception import Control.Monad import Test.HUnit import Test.AssertError testTests = t

    0熱度

    1回答

    命令cabal install正常工作,cabal configure --enable-tests也正常工作。然而,當我運行cabal build -j它不會編譯: Building MoodleLatex-0.1.0.0... Preprocessing executable 'moddlelat' for MoodleLatex-0.1.0.0... Preprocessing test

    1熱度

    1回答

    我試圖創建一個使用HUnit一個測試套件我哈斯克爾/驚天動地包,我得到以下錯誤,當我運行的陰謀測試: [email protected]:~/backup/projects/apollo$ cabal test Re-configuring with test suites enabled. If this fails, please run configure manually. Reso

    5熱度

    1回答

    我最近一直在嘗試使用travis CI與堆棧,我有 一直在運行一些問題。 我.travis.yml文件位於我的回購是在這裏: (我使用的堆棧網站上的指南) 我的配置文件的快照如下: sudo: false # Caching so the next build will be fast too. cache: directories: - $HOME/.stack b

    0熱度

    1回答

    我最近一直在使用HUnit測試框架在haskell中運行單元 測試。 我遇到了這個函數PutText和runTestText,它把PutText st作爲它的第一個參數 。 但是我不知道如何使用這個,並想了解如何使用它的一些幫助?

    0熱度

    1回答

    如何測試Control.Monad.Except(兩個後衛結果)像一個函數: foo :: Double -> Double -> Except String Double foo x y | x < -10.0 = throwError "Invalid parameter" | otherwise = pure $ x + y 使用hunit?

    3熱度

    1回答

    如果我有一個導致某個輸入發生錯誤的函數,是否可以編寫一個測試來驗證該輸入發生錯誤? 我在HUnit中找不到「assert error」功能。它在HUnit中還是可能在其他一些測試包中可用?