(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestEncodeDecodeBlob(t *testing.T) { |
| 13 | type gen func(*testing.T, int) []byte |
| 14 | tests := []gen{ |
| 15 | generateSequentialBytes, |
| 16 | readTxt, |
| 17 | } |
| 18 | for _, tt := range tests { |
| 19 | data := tt(t, 10*32) |
| 20 | t.Run("", func(t *testing.T) { |
| 21 | encoded := EncodeBlobs(data) |
| 22 | decoded := DecodeBlob(encoded[0][:]) |
| 23 | decoded = decoded[:len(data)] |
| 24 | if !bytes.Equal(data, decoded) { |
| 25 | t.Errorf("data:\n%v\nencoded/decoded:\n%v\n", data, decoded) |
| 26 | } |
| 27 | }) |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func generateSequentialBytes(t *testing.T, n int) []byte { |
| 32 | data := make([]byte, n) |
nothing calls this directly
no test coverage detected