업데이트haskeline
종속성을 추가 한 후 테스트가 통과되었습니다.테스트가 GHCI를 통과했지만 캐벌 테스트에 실패 함
cabal build
이 정상적으로 실행 되더라도 cabal test
은 내 테스트 사례를 찾을 수 없습니다. 다음은 cabal test
의 출력 (실패 함)이며 테스트 실행 파일 main
을 실행하는 GHCI (통과)의 출력입니다.
module Tests (
main
) where
import Data.Char
import Control.Monad
import System.IO
import System.Directory
import Test.HUnit
import Test.QuickCheck
import Main (four)
test1 = TestCase $ assertEqual "test upCase" "FOO" (map toUpper "foo")
test2 = TestCase $ assertEqual "testing that the result is 4" 4 4
test3 = TestCase $ assertEqual "testing that 4 is 4" four 4
tests = TestList [TestLabel "test1" test1, TestLabel "test2" test2, TestLabel "test3" test3]
main = runTestTT $ tests
내가 음모 기쁘게 무엇을 변경해야합니다 :
cabal test
Running 1 test suites...
Test suite test-one: RUNNING...
test-one: <stdin>: hGetLine: end of file
Test suite test-one: FAIL
Test suite logged to: dist/test/one-0.1.0.0-test-one.log
0 of 1 test suites (0 of 1 test cases) passed.
main
Cases: 3 Tried: 3 Errors: 0 Failures: 0
Counts {cases = 3, tried = 3, errors = 0, failures = 0}
다음은 이러한 출력을 생성하는 테스트 코드는?
내 .cabal
파일에는 다음이 포함
executable one
main-is: Main.hs
other-modules: Utils
build-depends: base ==4.6.*, mongoDB ==1.4.*, mtl ==2.1.*, directory ==1.2.*, text ==0.11.*, HUnit ==1.2.*, QuickCheck ==2.6.*
hs-source-dirs: src, tests
Test-Suite test-one
type: exitcode-stdio-1.0
main-is: Tests.hs
hs-source-dirs: src, tests
build-depends: base ==4.6.*, mongoDB ==1.4.*, mtl ==2.1.*, directory ==1.2.*, text ==0.11.*, HUnit ==1.2.*, QuickCheck ==2.6.*
.cabal 파일에'Test-Suite'를 지정 했습니까? – Zeta
예 ......... –
.cabal 파일을 보여주십시오. –