Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

bugfix: Ensure 'debug test' codelens only tests the selected test. #1561

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

kegsay
Copy link
Contributor

@kegsay kegsay commented Mar 6, 2018

If you have two functions TestFoo and TestFooTwo, and select
'debug test' on TestFoo, both tests will be executed. This happens
because go test -test.run expects a regular expression, but we were
only passing it a function name, causing both tests to pass the regex check.

Fixed by wrapping the function name in start/end markers.

This is similar to what we do when running the tests e.g.
https://github.com/Microsoft/vscode-go/blob/3d35f45653506e14d4e98689eb22dd7fe4654478/src/testUtils.ts#L222

If you have two functions `TestFoo` and `TestFooTwo`, and select
'debug test' on `TestFoo`, both tests will be executed. This happens
because `go test -test.run` expects a regular expression, but we were
only passing it a function name. Fixed by wrapping the function name
in start/end markers.
Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ramya-rao-a ramya-rao-a merged commit 5eab209 into microsoft:master Mar 15, 2018
@ramya-rao-a
Copy link
Contributor

@kegsay This fix is now available in the latest update (0.6.78) to the Go extension. Thanks for the PR!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants