如何使用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是在阴谋文件中定义的测试套件的名称。 Main.main指的是Main模块的main函数。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...