问题描述
我在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
函数。