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

testutils: relax regex to include just Test, Example and Benchmark as valid test functions #2071

Closed
buyology opened this issue Nov 1, 2018 · 2 comments

Comments

@buyology
Copy link
Contributor

buyology commented Nov 1, 2018

ad95b52 introduced a stricter regex for Test, Benchmark and Example to avoid matching just Test, Example or Benchmark.

These are in fact perfectly fine as function names:

package x

import "testing"

func Test(t *testing.T) {}
» go test -v
=== RUN   Test
--- PASS: Test (0.00s)
PASS
ok      x   0.007s
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Nov 1, 2018

I didnt realize that Test, Benchmark and Example were valid names for tests. Thanks for reporting!

PRs are most welcome!

Code Pointers:

@ramya-rao-a
Copy link
Contributor

The fix for this is now out in the latest update to the Go extension (0.8.0)
Thanks @Charliekenney23!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants