简体   繁体   English

在haskell中使用cabal和HUnit运行测试时出现问题(“ builds-depends”失败。)

[英]Issues running tests with cabal and HUnit in haskell ('builds-depends' failed.)

I trying to run my first haskell program using cabal and HUnit. 我试图使用cabal和HUnit运行我的第一个haskell程序。 I seem to have trouble with my .cabal as I get the error: 出现错误时,我的.cabal文件似乎出现了问题:

λ cabal test
.\haskell.cabal has been changed. Re-configuring with most recently used
options. If this fails, please run configure manually.
cabal: haskell.cabal:21: Parse of field 'build-depends' failed.

Here is the .cabal file 这是.cabal文件

name:                haskell
version:             0.1.0.0
synopsis:            fibonacci functions
category:            Testing

build-type:          Simple
cabal-version:       >=1.10


executable haskell
  main-is:             Main.hs

  build-depends:       base >=4.8 && <4.9
  hs-source-dirs:      src

  default-language:    Haskell2010

test-suite Tests
  build-depends:  Test.HUnit
  hs-source-dirs: test
  main-is: tests.hs
  Type: exitcode-stdio-1.0

test file: 测试文件:

import Test.HUnit
test1 = TestCase (assert True)

This is the problem: 这就是问题:

build-depends:  Test.HUnit

Perhaps you wanted build-depends: hunit ? 也许您想要build-depends: hunit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM