test: add test for generating requestid

This commit is contained in:
Anthony Laibe 2021-10-22 14:57:57 +02:00
parent 10378a5827
commit 3bf00b2f37
1 changed files with 15 additions and 0 deletions

View File

@ -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))
}
}