为了账号安全,请及时绑定邮箱和手机立即绑定

调试单个测试时如何提供测试标志?

调试单个测试时如何提供测试标志?

Go
小怪兽爱吃肉 2022-10-10 16:47:23
在调试单个测试时,即当我使用功能时,如何将测试标志(例如-test.v和标志)传递给测试程序?-test.vet=offGo: Debug Test at Cursor工作区设置部分也包含这些go.testFlags设置 - 但似乎它们仅在运行测试时有效(Go: Run Test at Cursor)。我正在使用 Visual Studio Code 1.61.2、vscode-go v0.28.1 和自动安装的 dlv-dap。
查看完整描述

1 回答

?
慕桂英3389331

TA贡献2036条经验 获得超8个赞

问题可能来自src/goTest.ts#_testAtCursor()

  if (cmd === 'debug') {

        return debugTestAtCursor(editor, testFunctionName, testFunctions, goConfig);

    } else if (cmd === 'benchmark' || cmd === 'test') {

        return runTestAtCursor(editor, testFunctionName, testFunctions, goConfig, cmd, args);

    } else {

        throw new Error(`Unsupported command: ${cmd}`);

    }

cmd, args调用时没有debugTestAtCursor(),而不是runTestAtCursor()。

这可能意味着当前实现不支持此功能。


查看完整回答
反对 回复 2022-10-10
  • 1 回答
  • 0 关注
  • 68 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信