This commit is contained in:
lbenedar
2026-03-06 17:59:31 +03:00
parent ec5ef9a5c1
commit 577f902ab3
8 changed files with 171 additions and 6 deletions

View File

@@ -1,6 +1,9 @@
package assert
import "testing"
import (
"strings"
"testing"
)
func Equal[T comparable](t *testing.T, actual, expected T) {
t.Helper()
@@ -9,3 +12,11 @@ func Equal[T comparable](t *testing.T, actual, expected T) {
t.Errorf("got: %v; want: %v", actual, expected)
}
}
func StringContains(t *testing.T, actual, expectedString string) {
t.Helper()
if !strings.Contains(actual, expectedString) {
t.Errorf("got: %q; expected to contain: %q", actual, expectedString)
}
}