Skip to content

Commit

Permalink
Improve error message on failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsutton committed Jun 5, 2023
1 parent 9370213 commit 6b5ceee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions p2p/net/mock/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,15 +642,15 @@ func TestEventBus(t *testing.T) {
t.Fatal("wrong remote peer")
}
if evnt.Connectedness != network.Connected {
t.Fatal("wrong connectedness type")
t.Fatalf("wrong connectedness type for sub0. Got: %v, expected: %v", evnt.Connectedness, network.Connected)
}
case evt := <-sub1.Out():
evnt := evt.(event.EvtPeerConnectednessChanged)
if evnt.Peer != id0 {
t.Fatal("wrong remote peer")
}
if evnt.Connectedness != network.Connected {
t.Fatal("wrong connectedness type")
t.Fatalf("wrong connectedness type for sub1. Got: %v, expected: %v", evnt.Connectedness, network.Connected)
}
case <-ctx.Done():
t.Fatal("didn't get connectedness events in time")
Expand All @@ -669,15 +669,15 @@ func TestEventBus(t *testing.T) {
t.Fatal("wrong remote peer")
}
if evnt.Connectedness != network.NotConnected {
t.Fatal("wrong connectedness type")
t.Fatalf("wrong connectedness type for sub0. Got: %v, expected: %v", evnt.Connectedness, network.NotConnected)
}
case evt := <-sub1.Out():
evnt := evt.(event.EvtPeerConnectednessChanged)
if evnt.Peer != id0 {
t.Fatal("wrong remote peer")
}
if evnt.Connectedness != network.NotConnected {
t.Fatal("wrong connectedness type")
t.Fatalf("wrong connectedness type for sub1. Got: %v, expected: %v", evnt.Connectedness, network.NotConnected)
}
case <-ctx.Done():
t.Fatal("didn't get connectedness events in time")
Expand Down

0 comments on commit 6b5ceee

Please sign in to comment.