...

Package assert

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

Overview ▾

Package assert provides helper functions for testing.

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'.