fixed a few stuff

This commit is contained in:
yusing
2025-02-10 13:05:21 +08:00
parent 73e2660e59
commit 2c57e439d5
11 changed files with 108 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
package utils
import (
"bytes"
"errors"
"os"
"reflect"
@@ -102,6 +103,14 @@ func ExpectDeepEqual[T any](t *testing.T, got T, want T) {
}
}
func ExpectBytesEqual(t *testing.T, got []byte, want []byte) {
t.Helper()
if !bytes.Equal(got, want) {
t.Errorf("expected:\n%v, got\n%v", want, got)
t.FailNow()
}
}
func ExpectTrue(t *testing.T, got bool) {
t.Helper()
if !got {