Files
cryptography/util/util_test.go
omicron 32bc802fa8
Some checks failed
Validate the build / validate-build (push) Failing after 1m0s
DROPME add failing test to check ci/cd
2025-05-20 22:39:20 +02:00

28 lines
580 B
Go

package util_test
import (
"testing"
"git.omicron.one/playground/cryptography/util"
"github.com/stretchr/testify/assert"
)
func TestDeHex(t *testing.T) {
b := util.DeHex("")
assert.NotNil(t, b)
assert.Len(t, b, 0)
assert.NotNil(t, nil, "testing ci/cd test failure")
b = util.DeHex("deadbeef")
assert.NotNil(t, b)
assert.Equal(t, []byte("\xde\xad\xbe\xef"), b)
assert.PanicsWithValue(t, "invalid hex string", func() {
util.DeHex("dead serious this is not a hex string")
})
assert.PanicsWithValue(t, "invalid hex string", func() {
util.DeHex("deada55")
})
}