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

标签 unit-testing debugging testing go code-duplication

既然去does not allow to debug tests in some IDEs (另请参见 issue)我不得不在我的 queue implementation 中编写两次测试。 .

里面一次main.go , 第二次 - 里面 queue_test.go

我将 Visual Studio Code 与 delve 结合使用。

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

最佳答案

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

尝试不同的东西。例如,截至今天,Gogland 的抢先体验版在调试方面工作得很好,即使是测试。它使用 Delve引擎盖下的调试器,所以你甚至可以求助于run the debugger从终端手动或检查它是否已经是 integrated使用您选择的 IDE。

关于unit-testing - 如何避免 Go 中的重复测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42940676/

相关文章:

node.js - 如何用 sinon 模拟事件?

c# - 如何为接受 xml 文件路径作为参数的方法编写单元测试

javascript - 如何调试在谷歌应用脚​​本中不相等的相同字符串?

unit-testing - 在测试类中组织单元测试

c++ - 使用 __debugbreak 在 GoogleTest 中捕获自定义断言

testing - 测试 Unix 域套接字的最佳方法(如 ab、wget 或 PostMan)

testing - 如何使用 Jenkins 自动化 Mocha 测试?

ruby - 如何调用参数传递的名称的方法?

debugging - Visual Studio 2013 仅在调试菜单中显示附加

javascript - 使用调试器时,如何强制 IE9 为 "see"最新的 javascript?