You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The testing package has long contained the Benchmark function, which allows code in a non-testing source file to run benchmarks.
It is sometimes useful to be able to run test code in a non-testing context too; for example to demonstrate a failing test in the Go playground.
Perhaps something like this?
// Test runs f as a test with the given name. Any test output
// is written to w. Test reports whether the test has succeeded.
func Test(w io.Writer, name string, f func(t *testing.T)) bool
The text was updated successfully, but these errors were encountered:
Looking at this again I am surprised that GitHub says I closed this. I suspect I clicked the wrong button again. I intended to leave it open for @rogpeppe to respond.
Thanks Russ - the close did feel a little sudden :) The playground was my main motivation behind raising this issue, so I think it's OK to close this issue. I might remember another use case in time though.
The testing package has long contained the Benchmark function, which allows code in a non-testing source file to run benchmarks.
It is sometimes useful to be able to run test code in a non-testing context too; for example to demonstrate a failing test in the Go playground.
Perhaps something like this?
The text was updated successfully, but these errors were encountered: