Reference
std/test
std/test
Assertions for test blocks: equality, panics and golden files.
narra
import * as Test from "std/test"
The guide teaches it in chapter 10, Effects and testing.
This page is generated by scripts/std/generate.nra from narrac query --json interface std/test. Do not edit it.
Functions
Details for every function below: only inside a test block.
eq
narra
export function eq<T: Equatable & Show>(actual: T, expected: T) uses alloc
Effects: alloc.
golden
narra
export function golden(name: string, actual: string) uses io
Effects: io.
ne
narra
export function ne<T: Equatable & Show>(actual: T, other: T) uses alloc
Effects: alloc.
panics
narra
export function panics(body: () => void) uses io
Effects: io.
panicsWith
narra
export function panicsWith(body: () => void, message: string) uses io
Effects: io.