You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
537 B

  1. package crypto_test
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/require"
  5. "github.com/tendermint/tendermint/crypto"
  6. )
  7. // the purpose of this test is primarily to ensure that the randomness
  8. // generation won't error.
  9. func TestRandomConsistency(t *testing.T) {
  10. x1 := crypto.CRandBytes(256)
  11. x2 := crypto.CRandBytes(256)
  12. x3 := crypto.CRandBytes(256)
  13. x4 := crypto.CRandBytes(256)
  14. x5 := crypto.CRandBytes(256)
  15. require.NotEqual(t, x1, x2)
  16. require.NotEqual(t, x3, x4)
  17. require.NotEqual(t, x4, x5)
  18. require.NotEqual(t, x1, x5)
  19. }