class AssertionFailure
source · line 25public
public class AssertionFailure public constructor(
/**
* The assertion operation that failed.
*/
public val kind: String,
/**
* Additional caller-supplied context, when provided.
*/
public val message: String?,
/**
* The source location attributed to the assertion failure.
*/
public val location: SourceLocation,
/**
* The expected operand's rendering result.
*/
public val expected: AssertionValue = AssertionValue.Unavailable,
/**
* The actual operand's rendering result.
*/
public val actual: AssertionValue = AssertionValue.Unavailable,
/**
* An underlying exception, such as the unexpected exception from assertFailsWith.
*/
public val cause: Throwable? = None
) : Throwable()
- Supertype
Throwable - Inherited
fun printStackTrace(): Unit· Throwable
Structured assertion failure information used by the test runner. Operand-rendering failures are retained in AssertionValue so they do not hide the original comparison failure.
property kind
source · line 29public
public val kind: String
get: public read-only
The assertion operation that failed.
property cause
source · line 49public
public val cause: Throwable? = None
get: public read-only
An underlying exception, such as the unexpected exception from assertFailsWith.
property actual
source · line 45public
public val actual: AssertionValue = AssertionValue.Unavailable
get: public read-only
The actual operand's rendering result.
property message
source · line 33public
public val message: String?
get: public read-only
Additional caller-supplied context, when provided.
property location
source · line 37public
public val location: SourceLocation
get: public read-only
The source location attributed to the assertion failure.
constructor constructor
source · line 25public
constructor(public val kind: String, public val message: String?, public val location: SourceLocation, public val expected: AssertionValue = AssertionValue.Unavailable, public val actual: AssertionValue = AssertionValue.Unavailable, public val cause: Throwable? = None)
parameter cause
source · line 49public
public val cause: Throwable? = None
parameter actual
source · line 45public
public val actual: AssertionValue = AssertionValue.Unavailable
parameter kind
source · line 29public
public val kind: String
parameter expected
source · line 41public
public val expected: AssertionValue = AssertionValue.Unavailable
parameter message
source · line 33public
public val message: String?
parameter location
source · line 37public
public val location: SourceLocation
property expected
source · line 41public
public val expected: AssertionValue = AssertionValue.Unavailable
get: public read-only
The expected operand's rendering result.