Documentation
¶
Overview ¶
Package assert provides minimal test assertion helpers. All functions stop the test immediately on failure (t.Fatalf).
Design: keep this package small — avoid adding new functions unless there is a clear need that cannot be covered by the existing ones. Prefer: Equal for comparable types, BytesEqual for []byte, DeepEqual for structs/maps/slices, True for boolean conditions, and Nil for nil checks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesEqual ¶
BytesEqual asserts that two byte slices are equal. On failure it reports the length mismatch or the first differing byte, avoiding logging raw byte slices which can be large and unreadable.
func DeepEqual ¶
DeepEqual asserts that two values are deeply equal using reflect.DeepEqual. Use for structs, maps, and non-byte slices. Use BytesEqual for []byte.
func Equal ¶
func Equal[T comparable](t testing.TB, expected, actual T, a ...any)
Equal asserts that two comparable values are equal using ==.
Types ¶
This section is empty.