mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 04:41:22 +00:00
committed by
Alexander Simmerl
parent
35b671214c
commit
b1e7fac787
23
crypto/random_test.go
Normal file
23
crypto/random_test.go
Normal file
@ -0,0 +1,23 @@
|
||||
package crypto_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/tendermint/tendermint/crypto"
|
||||
)
|
||||
|
||||
// the purpose of this test is primarily to ensure that the randomness
|
||||
// generation won't error.
|
||||
func TestRandomConsistency(t *testing.T) {
|
||||
x1 := crypto.CRandBytes(256)
|
||||
x2 := crypto.CRandBytes(256)
|
||||
x3 := crypto.CRandBytes(256)
|
||||
x4 := crypto.CRandBytes(256)
|
||||
x5 := crypto.CRandBytes(256)
|
||||
require.NotEqual(t, x1, x2)
|
||||
require.NotEqual(t, x3, x4)
|
||||
require.NotEqual(t, x4, x5)
|
||||
require.NotEqual(t, x1, x5)
|
||||
}
|
Reference in New Issue
Block a user