haskell - 如何使用 cabal 在 ghcid 中运行测试套件?

标签 haskell cabal ghcid

我在 https://www.parsonsmatt.org/2018/05/19/ghcid_for_the_win.html 的堆栈中找到了执行此操作的引用并在这里提到它:https://github.com/ndmitchell/ghcid/issues/128

我尝试过的:

[nix-shell:~/NewProjects/orgmode-parse]$ cabal v2-repl test
cabal: Cannot open a repl for the package test, it is not in this project
(either directly or indirectly). If you want to add it to the project then
edit the cabal.project file.

[nix-shell:~/NewProjects/orgmode-parse]$ cabal v2-repl Test.test
cabal: Unknown target 'Test.test'.
There is no component 'Test.test'.


[nix-shell:~/NewProjects/orgmode-parse]$ cabal v2-repl Test.test
cabal: Unknown target 'Test.test'.
There is no component 'Test.test'.

最佳答案

ghcid --command='cabal v2-repl test:tests' --test 'Main.main'

其中 tests 是 cabal 文件中定义的测试套件的名称。而Main.main是指Main模块的main函数。

关于haskell - 如何使用 cabal 在 ghcid 中运行测试套件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63428300/

相关文章:

dictionary - 更新 Haskell Map 中的项目,如何?

Haskell 遇到非常简单的记录语法问题

haskell - 如何在我的 cabal 包中指定 "internal"模块

haskell - 为什么 Cabal 在 cabal 初始化后不问我任何问题

haskell - cabal 安装 fpco-api 错误

haskell - 转换为 Pointfree 风格?

Haskell 列表理解顺序元素/元组