Assert Module
Types and nested modules
| Type/Module | Description |
|
Helpers for collecting multiple independent assertion results. |
|
|
Opaque collector that stores multiple assertion results for later aggregation. |
Functions and values
| Function or value |
Description
|
||
|
Raises when the supplied assertion result is not
|
||
Full Usage:
Assert.result expectation actual
Parameters:
AssertExpectation<'T>
-
The reusable expectation to verify.
actual : Expr<'T>
-
The quoted expression under test.
Returns: AssertResult
Passed when the quoted expression satisfies the expectation; otherwise a structured
Failed result describing the mismatch.
|
Evaluates an assertion expectation against a quoted expression.
The quotation is evaluated by this call. Use
Example
val result: obj
|
||
Full Usage:
Assert.resultAsync expectation actual
Parameters:
AssertExpectation<'T>
-
The reusable expectation to verify.
actual : Expr
-
The quoted asynchronous expression under test, typically producing Async<'T>,
Task<'T>, or another awaitable value supported by Testify.
Returns: Task<AssertResult>
A task that completes with Passed when the asynchronous computation satisfies the
expectation, or Failed when it does not.
|
Evaluates an asynchronous assertion and returns the result inside a task. The quoted asynchronous computation is awaited by this call.
Example
val task: TaskBuilder
|
||
Full Usage:
Assert.resultNamed test expectation actual
Parameters:
string
-
The human-readable label to show instead of the rendered quotation.
expectation : AssertExpectation<'T>
-
The reusable expectation to verify.
actual : Expr<'T>
-
The quoted expression under test.
Returns: AssertResult
Passed when the quoted expression satisfies the expectation; otherwise a structured
Failed result that uses test in its report output.
|
Evaluates an assertion like The quotation is still evaluated by this call even when a custom label is supplied.
Example
val result: obj
|
||
Full Usage:
Assert.should expectation actual
Parameters:
AssertExpectation<'T>
-
The reusable expectation to verify.
actual : Expr<'T>
-
The quoted expression under test.
|
Runs an assertion and raises immediately when it fails. The quotation is evaluated by this call.
Example
|
||
Full Usage:
Assert.shouldAsync expectation actual
Parameters:
AssertExpectation<'T>
-
The reusable expectation to verify.
actual : Expr
-
The quoted asynchronous expression under test.
Returns: Task
A task that completes when the assertion has finished running.
|
Runs an asynchronous assertion and raises immediately when it fails.
Example
val task: TaskBuilder
|
||
Full Usage:
Assert.toDisplayString result
Parameters:
AssertResult
-
The assertion result to render.
Returns: string
The configured rendered representation suitable for terminal output or test failures.
|
Renders an assertion result using the current Testify report options.
|
||
Full Usage:
Assert.toDisplayStringWith options result
Parameters:
TestifyReportOptions
-
The report rendering options to use.
result : AssertResult
-
The assertion result to render.
Returns: string
The configured rendered representation suitable for terminal output or test failures.
|
Renders an assertion result with the supplied report options.
|
||
Full Usage:
Assert.toFailureReport result
Parameters:
AssertResult
-
The assertion result to translate.
Returns: TestifyFailureReport option
Some failure report when result is Failed; otherwise None.
|
Converts a failed assertion into a structured Testify failure report.
|
testify