MCPcopy
hub / github.com/stretchr/testify / TestCondition

Function TestCondition

assert/assertions_test.go:1504–1516  ·  assert/assertions_test.go::TestCondition
(t *testing.T)

Source from the content-addressed store, hash-verified

1502}
1503
1504func TestCondition(t *testing.T) {
1505 t.Parallel()
1506
1507 mockT := new(testing.T)
1508
1509 if !Condition(mockT, func() bool { return true }, "Truth") {
1510 t.Error("Condition should return true")
1511 }
1512
1513 if Condition(mockT, func() bool { return false }, "Lie") {
1514 t.Error("Condition should return false")
1515 }
1516}
1517
1518func TestDidPanic(t *testing.T) {
1519 t.Parallel()

Callers

nothing calls this directly

Calls 2

ConditionFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected