mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-26 19:11:08 +01:00
refactor: clean up code and enhance utilities with new functions
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user