♻️ Replace testify with be for tests

This commit is contained in:
Dan Jones 2025-09-26 20:23:32 -05:00
commit 4d723077e1
8 changed files with 79 additions and 91 deletions

View file

@ -4,14 +4,14 @@ import (
"testing"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
"github.com/nalgeon/be"
)
func TestUUID(t *testing.T) {
st, err := UUID(nil)(nil)
assert.NoError(t, err)
be.Err(t, err, nil)
_, parseErr := uuid.Parse(st)
assert.NoError(t, parseErr)
be.Err(t, parseErr, nil)
}
type badRead struct{}
@ -25,17 +25,17 @@ func TestUUIDFail(t *testing.T) {
defer uuid.SetRand(nil)
_, err := UUID(nil)(nil)
assert.ErrorIs(t, err, errTest)
be.Err(t, err, errTest)
}
func TestRand(t *testing.T) {
st, err := Random()(nil)
assert.NoError(t, err)
assert.Len(t, st, 8)
be.Err(t, err, nil)
be.Equal(t, len(st), 8)
}
func TestRandLen(t *testing.T) {
st, err := Random(RandomLength(32))(nil)
assert.NoError(t, err)
assert.Len(t, st, 32)
be.Err(t, err, nil)
be.Equal(t, len(st), 32)
}