aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing.go b/testing.go
index ba22828..40b0c42 100644
--- a/testing.go
+++ b/testing.go
@@ -20,6 +20,15 @@ type T struct {
wg sync.WaitGroup
}
+func (t *T) Assert(b bool) bool {
+ t.Helper()
+
+ if !b {
+ t.Error("\nexepected value to be true")
+ }
+ return b
+}
+
func (t *T) AssertEqual(exp, actual any) bool {
t.Helper()
@@ -67,6 +76,15 @@ func (t *T) AssertPanicsWith(f func(), exp any) (b bool) {
return true
}
+func (t *T) AssertNot(b bool) bool {
+ t.Helper()
+
+ if b {
+ t.Error("\nexpected value to be false")
+ }
+ return !b
+}
+
func (t *T) AssertNotEqual(notExp, actual any) bool {
t.Helper()