Header menu logo testify

AssertFailure Type

Structured information describing one failed assertion.

Testify fills this record when an Assert operation does not satisfy its expectation. The values are already formatted for diagnostics and report rendering.

Record fields

Record Field Description

Actual

Full Usage: Actual

Field type: string

The rendered observed value or exception.

Field type: string

ActualObservedInfo

Full Usage: ActualObservedInfo

Field type: TestifyObservedInfo

Structured metadata describing the observed value or exception.

Field type: TestifyObservedInfo

Because

Full Usage: Because

Field type: string option

An optional explanation describing why the assertion failed.

Field type: string option

Details

Full Usage: Details

Field type: FailureDetails option

Optional structured nested details used by the rich failure renderer.

Field type: FailureDetails option

Expected

Full Usage: Expected

Field type: string

The human-readable expectation description shown in failure output.

Field type: string

ExpectedObservedInfo

Full Usage: ExpectedObservedInfo

Field type: TestifyObservedInfo option

Structured metadata describing the expected observation when Testify can recover it.

Field type: TestifyObservedInfo option

Label

Full Usage: Label

Field type: string

The stable expectation label, such as EqualTo or Throws.

Field type: string

SourceLocation

Full Usage: SourceLocation

Field type: SourceLocation option

The most relevant source location that Testify could recover for the failure.

Field type: SourceLocation option

Test

Full Usage: Test

Field type: string

The rendered test expression or explicit label that was checked.

Field type: string

Type something to start searching.