summaryrefslogtreecommitdiff
path: root/pkg/pls/random_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/pls/random_test.go')
-rw-r--r--pkg/pls/random_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkg/pls/random_test.go b/pkg/pls/random_test.go
new file mode 100644
index 0000000..56dfb2d
--- /dev/null
+++ b/pkg/pls/random_test.go
@@ -0,0 +1,17 @@
+package pls
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestGenerateRandomHex(t *testing.T) {
+ t.Run("returns a random nonce each time", func(t *testing.T) {
+ item := GenerateRandomHex(32)
+
+ require.NotEmpty(t, item)
+ assert.NotEqual(t, item, GenerateRandomHex(32))
+ })
+}