assert icon indicating copy to clipboard operation
assert copied to clipboard

assert.True and assert.False should print the given msgAndArgs

Open tamj0rd2 opened this issue 3 years ago • 0 comments

My code:

assert.True(t, req.Tariff.PercentPerScheme.Other == nil, "other percent should be nil")

Expected output:

mapping_test.go:60: other percent should be nil

Actual output:

mapping_test.go:60: Expected expression to be true

Area of code that would need changing:

// True asserts that an expression is true.
func True(t testing.TB, ok bool, msgAndArgs ...interface{}) {
	if ok {
		return
	}
	t.Helper()
	t.Fatal("Expected expression to be true")
}

// False asserts that an expression is false.
func False(t testing.TB, ok bool, msgAndArgs ...interface{}) {
	if !ok {
		return
	}
	t.Helper()
	t.Fatal("Expected expression to be false")
}

Happy to submit a PR in a little bit

tamj0rd2 avatar Apr 26 '22 10:04 tamj0rd2