英文:
Emacs `haskell-compile` for unit tests
问题
- 如果我需要运行
cabal test
怎么办? - 如果我需要运行
cabal run
怎么办?
英文:
Emacs newbie here, transitioning from Neovim.
I have a project in Haskell, and I am aware that I can run haskell-compile
and it will execute cabal build
. 2 questions please:
- What can I do if I need
cabal test
? - What can I do if I need
cabal run
?
答案1
得分: 0
以下是您要翻译的内容:
对于未来的谷歌搜索用户,这是我采用的解决方案:
(general-nmap haskell-mode-map
"<leader>b" '(lambda ()
(interactive)
(save-some-buffers t)
(setq-local haskell-compile-cabal-build-command "cabal build")
(haskell-compile)))
(general-nmap haskell-mode-map
"<leader>t" '(lambda ()
(interactive)
(save-some-buffers t)
(setq-local haskell-compile-cabal-build-command "cabal test")
(haskell-compile)))
英文:
For future googlers, here is the solution I adopted:
(general-nmap haskell-mode-map
"<leader>b" '(lambda ()
(interactive)
(save-some-buffers t)
(setq-local haskell-compile-cabal-build-command "cabal build")
(haskell-compile)))
(general-nmap haskell-mode-map
"<leader>t" '(lambda ()
(interactive)
(save-some-buffers t)
(setq-local haskell-compile-cabal-build-command "cabal test")
(haskell-compile)))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论