我在 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/