Skip to content

Commit

Permalink
Make output nicer when queues are not equal
Browse files Browse the repository at this point in the history
  • Loading branch information
p-offtermatt committed Mar 8, 2024
1 parent 8a277fe commit 73247ef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/mbt/driver/mbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,19 @@ func ComparePacketQueue(
modelSenderQueue := PacketQueue(currentModelState, sender, receiver)
actualSenderQueue := driver.packetQueue(ChainId(sender), ChainId(receiver))

actualPacketStrings := make([]string, len(actualSenderQueue))
for i, packet := range actualSenderQueue {
actualPacketStrings[i] = string(packet.Packet.GetData())
}

require.Equal(t,
len(modelSenderQueue),
len(actualSenderQueue),
"Packet queue sizes do not match for sender %v, receiver %v.\n model: %v\n actual: %v",
sender,
receiver,
modelSenderQueue,
actualSenderQueue)
pretty.Sprint(modelSenderQueue),
pretty.Sprint(actualPacketStrings))

for i := range modelSenderQueue {
actualPacket := actualSenderQueue[i]
Expand Down

0 comments on commit 73247ef

Please sign in to comment.