MCPcopy Create free account
hub / github.com/stretchr/testify / TestCondition

Function TestCondition

assert/assertions_test.go:1438–1449  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1436}
1437
1438func TestCondition(t *testing.T) {
1439 mockT := new(testing.T)
1440
1441 if !Condition(mockT, func() bool { return true }, "Truth") {
1442 t.Error("Condition should return true")
1443 }
1444
1445 if Condition(mockT, func() bool { return false }, "Lie") {
1446 t.Error("Condition should return false")
1447 }
1448
1449}
1450
1451func TestDidPanic(t *testing.T) {
1452

Callers

nothing calls this directly

Calls 2

ConditionFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected