I'm sorry, I think I made a huge mistake. The malicious output only occurs
when running go test with the -race flag.
Am Freitag, 25. August 2017 22:35:21 UTC+2 schrieb lukas@googlemail.com:
>
> I'm using helper functions in my test, for example this one:
>
> // assert fails the test if the co
package bug
// Pow returns x raised to the power of y i.e. x^y.
func Pow(x, y int) int {
return x ^ y
}
package bug_test
import (
"fmt"
"testing"
"github.com/lukasmalkmus/bug"
)
func TestPow(t *testing.T) {
tests := []struct {
x, y, z int
}{
{0, 0, 0},
{1, 0, 1},
{0, 1, 11},
}
for _, tt := ra
It is part of the interface...
Am Freitag, 25. August 2017 22:35:21 UTC+2 schrieb lukas@googlemail.com:
>
> I'm using helper functions in my test, for example this one:
>
> // assert fails the test if the condition is false.
> func assert(tb testing.TB, condition bool, msg string, v ...interfa
I'm using helper functions in my test, for example this one:
// assert fails the test if the condition is false.
func assert(tb testing.TB, condition bool, msg string, v ...interface{}) {
if !condition {
_, file, line, _ := runtime.Caller(1)
fmt.Printf("\033[31m%s:%d: "+msg+"\033[39m\n\n", appe