Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/playground: multifile code should support tests too #32403

Open
rogpeppe opened this issue Jun 3, 2019 · 6 comments
Open

x/playground: multifile code should support tests too #32403

rogpeppe opened this issue Jun 3, 2019 · 6 comments
Labels
FeatureRequest help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Jun 3, 2019

The playground docs say:

If the program contains tests or examples and no main function, the service runs the tests.

This example contains tests and no main function, but it doesn't work. Looks like that's because it also contains other files.

https://play.golang.org/p/eYjtKS7J25y

I'd expect the example to run TestFoo as a test.

@bcmills bcmills changed the title playground: multifile code should support tests too x/playground: multifile code should support tests too Jun 3, 2019
@gopherbot gopherbot added this to the Unreleased milestone Jun 3, 2019
@bcmills
Copy link
Contributor

bcmills commented Jun 3, 2019

For an even smaller repro, compare:

https://play.golang.org/p/t-tmCBPADwt compiles and runs.

https://play.golang.org/p/PkTK3_aY7L8, which adds only a go.mod file, fails:

# example.com
runtime.main_main·f: function main is undeclared in the main package

Go build failed.

@bcmills bcmills added help wanted NeedsFix The path to resolution is known, but the work has not been done. labels Jun 3, 2019
@bcmills
Copy link
Contributor

bcmills commented Jun 3, 2019

CC @ysmolsky @andybons @dmitshur

@bcmills
Copy link
Contributor

bcmills commented Jun 3, 2019

This support would be really useful for go test reports like the one in #32379.

@rogpeppe
Copy link
Contributor Author

rogpeppe commented Dec 3, 2021

Ha, I just went to report this problem and found that I reported it over 2 years ago. 🤣 Surely it's not that hard to fix?

@nikola-jokic
Copy link
Contributor

Can I take this one? ☺️

@gopherbot
Copy link

Change https://go.dev/cl/462835 mentions this issue: x/playground: support multifile code with tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants