func Error(t *testing.T, err error, args ...interface{}) bool {
	if err != nil {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, err, "<non-nil>", args...)
	return false
}
Error checks that err is non-nil.
package test
import (
	"strings"
	"testing"
	"unicode"
	"github.com/davecgh/go-spew/spew"
	"github.com/maxatome/go-testdeep/helpers/tdutil"
)
func EqualErrorMessage(t *testing.T, got, expected interface{},
	args ...interface{}) {
	t.Helper()
	testName := tdutil.BuildTestName(args...)
	if testName != "" {
		testName = " '" + testName + "'"
	}
	t.Errorf(`Failed test%s
	     got: %v
	expected: %v`,
		testName, got, expected)
}
func spewIfNeeded(s string) string {
	for _, chr := range s {
		if !unicode.IsPrint(chr) {
			return strings.TrimRight(spew.Sdump(s), "\n")
		}
	}
	return s
}
func EqualStr(t *testing.T, got, expected string, args ...interface{}) bool {
	if got == expected {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, spewIfNeeded(got), spewIfNeeded(expected), args...)
	return false
}
func EqualInt(t *testing.T, got, expected int, args ...interface{}) bool {
	if got == expected {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, got, expected, args...)
	return false
}
func EqualBool(t *testing.T, got, expected bool, args ...interface{}) bool {
	if got == expected {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, got, expected, args...)
	return false
}
func IsTrue(t *testing.T, got bool, args ...interface{}) bool {
	if got {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, false, true, args...)
	return false
}
func IsFalse(t *testing.T, got bool, args ...interface{}) bool {
	if !got {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, true, false, args...)
	return false
}
func CheckPanic(t *testing.T, fn func(), contains string) bool {
	t.Helper()
	var (
		panicked   bool
		panicParam interface{}
	)
	func() {
		defer func() { panicParam = recover() }()
		panicked = true
		fn()
		panicked = false
	}()
	if !panicked {
		t.Error("panic() did not occur")
		return false
	}
	panicStr, ok := panicParam.(string)
	if !ok {
		t.Errorf("panic() occurred but recover()d %T type (%v) instead of string",
			panicParam, panicParam)
		return false
	}
	if !strings.Contains(panicStr, contains) {
		t.Errorf("panic() string `%s'\ndoes not contain `%s'", panicStr, contains)
		return false
	}
	return true
}
func NoError(t *testing.T, err error, args ...interface{}) bool {
	if err == nil {
		return true
	}
	t.Helper()
	EqualErrorMessage(t, err, nil, args...)
	return false
}