Accept an interface instead of testing.T (#1)

This commit is contained in:
Crow Crowcrow 2020-01-17 22:36:24 +01:00 committed by Gitea
parent 66ad00ea84
commit fe8a28286e
3 changed files with 10 additions and 5 deletions

View file

@ -3,14 +3,13 @@ package assert
import (
"reflect"
"runtime"
"testing"
)
// Assert is a helper for tests
type Assert func(bool, ...interface{})
// New returns a new Assert
func New(t *testing.T) Assert {
func New(t T) Assert {
a := func(ok bool, msg ...interface{}) {
if !ok {
if msg == nil {