Testing module

expect_equal

procedure · 1 overloadsince 0.28.0Source

got and want are compared by value: numbers of any width, strings, enums, arrays element by element (fixed, view and resizable alike) and structs member by member. Strings and arrays that differ get a diff.

expect_equal :: (got: $T, want: $U, loc := #caller_location) -> bool

got and want are compared by value: numbers of any width, strings, enums, arrays element by element (fixed, view and resizable alike) and structs member by member. Strings and arrays that differ get a diff.

Parameters

got: $T
the value under test.
want: $U
the value it must equal.
loc := #caller_location
where the check is written, shown when it fails. Leave the default.

Returns

bool

See also