On Jun 8, 1:50 pm, minux <
minux...@gmail.com> wrote:
>
> $ go test -v qwerty_test.go
> === RUN TestSomething
> hello--- PASS: TestSomething (0.00 seconds)
> qwerty_test.go:7: hello
> PASS
> ok command-line-arguments 0.024s
>
> in general, go test (without -v) won't show test outputs (simply discarded).
Thanks for your help, I've figured it out.
My code had an error in it where I was calling panic and passing a
nil.
This somehow causes the test to immediately end (and thus never
calling the statements that do printing).
YET, the pass does not fail.
Try running this and you'll see what I mean...
package qwerty
import (
"fmt"
"testing"
)
func TestSomething(t *testing.T) {
panic(nil)
t.Logf("hello")
fmt.Printf("hello")
}
Is this a bug?