update go mod
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-01-25 20:08:57 +03:00
parent e2a2db01bb
commit d864996848
9 changed files with 89 additions and 65 deletions

28
test/require/equal.go Normal file
View File

@@ -0,0 +1,28 @@
package require
import (
"reflect"
"testing"
)
func Equal(t *testing.T, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
t.Helper()
if reflect.DeepEqual(expected, actual) {
return
}
t.Error(msgAndArgs...)
t.FailNow()
}
func Equalf(t *testing.T, expected interface{}, actual interface{}, msg string, args ...interface{}) {
t.Helper()
if reflect.DeepEqual(expected, actual) {
return
}
t.Errorf(msg, args...)
t.FailNow()
}

23
test/require/error.go Normal file
View File

@@ -0,0 +1,23 @@
package require
import (
"testing"
)
func NoError(t *testing.T, err error, msgAndArgs ...interface{}) {
t.Helper()
if err != nil {
t.Error(msgAndArgs...)
t.FailNow()
}
}
func NoErrorf(t *testing.T, err error, msg string, args ...interface{}) {
t.Helper()
if err != nil {
t.Errorf(msg, args...)
t.FailNow()
}
}

9
test/require/fail.go Normal file
View File

@@ -0,0 +1,9 @@
package require
import "testing"
func Fail(t *testing.T, msg string, args ...interface{}) {
t.Helper()
t.Errorf(msg, args...)
t.FailNow()
}

14
test/require/true.go Normal file
View File

@@ -0,0 +1,14 @@
package require
import (
"testing"
)
func Truef(t *testing.T, value bool, msg string, args ...interface{}) {
t.Helper()
if !value {
t.Errorf(msg, args...)
t.FailNow()
}
}