如何避免Go中的重复测试?

时间:2017-03-22 00:33:18

标签: unit-testing debugging testing go code-duplication

由于Go does not allow to debug tests in some IDEs(另请参阅此issue),我必须在queue implementation中两次编写测试。

一次在main.go内,第二次 - 在queue_test.go

我使用Visual Studio Code with delve。

调试Go测试而不重复测试的最佳IDE或模式是什么?

1 个答案:

答案 0 :(得分:3)

我认为您的IDE无法调试测试。

尝试不同的东西。例如,截至今天,即使使用测试,Gogland的早期访问版本在调试方面也能很好地工作。它使用了Delve调试器,因此您甚至可以从终端手动使用run the debugger或使用您选择的IDE检查它是否已integrated

相关问题