Initial commit

This commit is contained in:
Nise Void 2018-12-03 22:40:34 +01:00
commit 977c232584
Signed by: NiseVoid
GPG key ID: FBA14AC83EA602F3
2 changed files with 184 additions and 0 deletions

24
helper.go Normal file
View file

@ -0,0 +1,24 @@
package assert
import (
"fmt"
"reflect"
"runtime"
"strconv"
"testing"
)
func prepMsg(msg []interface{}, format string, args ...interface{}) []interface{} {
return append(msg, "\n\n", fmt.Sprintf(format, args...))
}
func shell(i int) string {
return "\x1B[" + strconv.Itoa(i) + "m"
}
var ts = map[*runtime.Func]*testing.T{}
func t(a Assert) *testing.T {
f := runtime.FuncForPC(reflect.ValueOf(a).Pointer())
return ts[f]
}