From 3bf00b2f3747e7a28113c2b6e8425b61e70eb7f0 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 22 Oct 2021 14:57:57 +0200 Subject: [PATCH] test: add test for generating requestid --- waku/v2/protocol/requestId_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 waku/v2/protocol/requestId_test.go diff --git a/waku/v2/protocol/requestId_test.go b/waku/v2/protocol/requestId_test.go new file mode 100644 index 00000000..2c38ffcd --- /dev/null +++ b/waku/v2/protocol/requestId_test.go @@ -0,0 +1,15 @@ +package protocol + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGenerateRequestId(t *testing.T) { + // Force 2 reseed to ensure this is working as expected + for i := 1; i < 20001; i++ { + bytes := GenerateRequestId() + require.Equal(t, 32, len(bytes)) + } +}