package assert

import "github.com/magiconair/properties/assert"

Package assert provides helper functions for testing.

Index

Functions

func Equal

func Equal(t *testing.T, got, want interface{}, msg ...string)

Equal asserts that got and want are equal as defined by reflect.DeepEqual. The test fails with msg if they are not equal.

func Matches

func Matches(t *testing.T, value, expr string)

Matches asserts that a value matches a given regular expression.

func Panic

func Panic(t *testing.T, fn func(), matches string)

Panic asserts that function fn() panics. It assumes that recover() either returns a string or an error and fails if the message does not match the regular expression in 'matches'.

Source Files

assert.go

Version
v1.8.10 (latest)
Published
Apr 9, 2025
Platform
windows/amd64
Imports
7 packages
Last checked
1 hour ago

Tools for package owners.