【问题标题】:How to run test suite in ghcid with cabal?如何使用 cabal 在 ghcid 中运行测试套件?
【发布时间】:2020-08-15 16:24:44
【问题描述】:

我在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'.

【问题讨论】:

    标签: haskell cabal ghcid


    【解决方案1】:
    ghcid --command='cabal v2-repl test:tests' --test 'Main.main'
    

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

    【讨论】:

    猜你喜欢
    • 2021-07-22
    • 1970-01-01
    • 1970-01-01
    • 2021-02-11
    • 1970-01-01
    • 2020-12-17
    • 1970-01-01
    • 2014-01-23
    • 1970-01-01
    相关资源
    最近更新 更多