mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 04:52:59 +01:00
go: Fix unit test for non-deterministic map ordering
This commit is contained in:
parent
06ba74c366
commit
c96a39d315
@ -246,7 +246,14 @@ func TestPackMap(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("err != nil")
|
t.Error("err != nil")
|
||||||
}
|
}
|
||||||
if bytes.Compare(b.Bytes(), []byte{0x83, 0x00, 0x01, 0x04, 0x05, 0x02, 0x03}) != 0 {
|
|
||||||
|
// map ordering is no longer deterministic -- check all possible orderings :(
|
||||||
|
if bytes.Compare(b.Bytes(), []byte{0x83, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05}) != 0 &&
|
||||||
|
bytes.Compare(b.Bytes(), []byte{0x83, 0x00, 0x01, 0x04, 0x05, 0x02, 0x03}) != 0 &&
|
||||||
|
bytes.Compare(b.Bytes(), []byte{0x83, 0x02, 0x03, 0x00, 0x01, 0x04, 0x05}) != 0 &&
|
||||||
|
bytes.Compare(b.Bytes(), []byte{0x83, 0x02, 0x03, 0x04, 0x05, 0x00, 0x01}) != 0 &&
|
||||||
|
bytes.Compare(b.Bytes(), []byte{0x83, 0x04, 0x05, 0x00, 0x01, 0x02, 0x03}) != 0 &&
|
||||||
|
bytes.Compare(b.Bytes(), []byte{0x83, 0x04, 0x05, 0x02, 0x03, 0x00, 0x01}) != 0 {
|
||||||
t.Error("wrong output", b.Bytes())
|
t.Error("wrong output", b.Bytes())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user