Files
cunicu/pkg/crypto/crypto_test.go
T
Steffen Vogel dad8d5996b update Go module path
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-09-08 17:42:12 +02:00

27 lines
520 B
Go

package crypto_test
import (
"testing"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/stv0g/cunicu/pkg/crypto"
"github.com/stv0g/cunicu/test"
)
func TestSuite(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Crypto Suite")
}
var _ = test.SetupLogging()
var _ = Describe("nonce", func() {
It("can generate a valid nonce", func() {
nonce, err := crypto.GetNonce(100)
Expect(err).To(Succeed())
Expect(nonce).To(HaveLen(100))
Expect([]byte(nonce)).To(test.BeRandom())
})
})