如果我有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
命令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
我試圖創建一個使用HUnit一個測試套件我哈斯克爾/驚天動地包,我得到以下錯誤,當我運行的陰謀測試: [email protected]:~/backup/projects/apollo$ cabal test
Re-configuring with test suites enabled. If this fails, please run configure
manually.
Reso
我最近一直在嘗試使用travis CI與堆棧,我有 一直在運行一些問題。 我.travis.yml文件位於我的回購是在這裏: (我使用的堆棧網站上的指南) 我的配置文件的快照如下: sudo: false
# Caching so the next build will be fast too.
cache:
directories:
- $HOME/.stack
b
如何測試Control.Monad.Except(兩個後衛結果)像一個函數: foo :: Double -> Double -> Except String Double
foo x y
| x < -10.0 = throwError "Invalid parameter"
| otherwise = pure $ x + y
使用hunit?