nomoresecrets_test.go 1011 B

12345678910111213141516171819202122232425
  1. package door
  2. import (
  3. "math/rand"
  4. "testing"
  5. )
  6. func TestRandom(t *testing.T) {
  7. rand.Seed(10)
  8. var byteBuffer []byte
  9. var expectBuffer []byte = []byte{0x61, 0xb5, 0xc8, 0xac, 0x79, 0x39, 0xde, 0xda, 0x62, 0xd3, 0x90, 0x4c, 0x63, 0x72, 0xa7, 0x93, 0x9b, 0xb0, 0x9c, 0x9d, 0x31, 0xd5, 0xbb, 0x9a, 0x32, 0xc4, 0x41, 0x77, 0x9d, 0xb1, 0xc3, 0x36, 0x8e, 0x63, 0xc7, 0xdd, 0x6c, 0xab, 0x80, 0x9a, 0x32, 0xc4, 0xa5, 0x9b, 0xa9, 0x60, 0xa8, 0xaa, 0xbc, 0xca, 0x85, 0x70, 0x7e, 0xd2, 0x2a, 0x3c, 0x6f, 0xab, 0x2c, 0xa5, 0x6f, 0x33, 0x89, 0xc7, 0x47, 0x5d, 0xbf, 0x50, 0x76, 0x2b, 0xd9, 0x2e, 0xdc, 0xae, 0xbb, 0xd6, 0x59, 0xda, 0x8a, 0xde, 0x38, 0xae, 0xd4, 0xa9, 0x8d, 0x65, 0xbc, 0x7d, 0xbe, 0xd4, 0xb2, 0x88, 0xb4, 0x39, 0xce, 0xb9, 0xb8, 0x26, 0x93, 0x5b}
  10. byteBuffer = make([]byte, 100)
  11. var x int
  12. for x = 0; x < 100; x++ {
  13. byteBuffer[x] = getRandom()
  14. if expectBuffer[x] != byteBuffer[x] {
  15. t.Errorf("%d %d != %d\n", x, expectBuffer[x], byteBuffer[x])
  16. }
  17. }
  18. }
  19. func TestNoMoreSecrets(t *testing.T) {
  20. }