(t *testing.T)
| 233 | } |
| 234 | |
| 235 | func TestMapIsDeterministic(t *testing.T) { |
| 236 | hello := multiappend([]byte{toCborHeader(TypeBytes, 5)}, []byte("hello")) |
| 237 | hello2 := multiappend([]byte{toCborHeader(TypeBytes, 6)}, []byte("hello2")) |
| 238 | testMap := multiappend([]byte{toCborHeader(TypeMap, 2)}, hello, uint24, hello2, uint4294967295) |
| 239 | cborSequenceMap := multiappend(testMap, testMap) |
| 240 | |
| 241 | for _, testCase := range [][]byte{testMap, cborSequenceMap} { |
| 242 | if err := Deterministic(testCase); err != nil { |
| 243 | t.Error("Deterministically encoded CBOR map should not return false for deterministicy.") |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | func TestMapWithDuplicateKeysIsNotDeterministic(t *testing.T) { |
| 249 | hello := multiappend([]byte{toCborHeader(TypeBytes, 5)}, []byte("hello")) |
nothing calls this directly
no test coverage detected