MCPcopy Index your code
hub / github.com/cockroachdb/errors / Check

Method Check

testutils/simplecheck.go:114–119  ·  view source on GitHub ↗

Check calls t.Error if the condition is false. Also the text of the condition is printed.

(cond bool)

Source from the content-addressed store, hash-verified

112// Check calls t.Error if the condition is false. Also
113// the text of the condition is printed.
114func (t *T) Check(cond bool) {
115 t.Helper()
116 if !cond {
117 t.failWithf(false, "check failed")
118 }
119}
120
121// CheckEqual checks that the value is equal to some reference.
122func (t *T) CheckEqual(val, ref interface{}) {

Callers 15

TestUnwrapFunction · 0.95
TestWithContextFunction · 0.95
TestHideCauseFunction · 0.95
TestBarrierMaskedDetailsFunction · 0.95
TestErrorPredicatesUnixFunction · 0.95
TestErrorPredicatesFunction · 0.95
TestErrorTypeEquivalenceFunction · 0.95

Calls 1

failWithfMethod · 0.95

Tested by 15

TestUnwrapFunction · 0.76
TestWithContextFunction · 0.76
TestHideCauseFunction · 0.76
TestBarrierMaskedDetailsFunction · 0.76
TestErrorPredicatesUnixFunction · 0.76
TestErrorPredicatesFunction · 0.76
TestErrorTypeEquivalenceFunction · 0.76