Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Sep 7, 2023
1 parent e388576 commit 2b8f0ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions p2p/net/swarm/swarm_dial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ func TestAddrsForDialFiltering(t *testing.T) {
t1 := ma.StringCast("/ip4/1.2.3.4/tcp/1")
ws1 := ma.StringCast("/ip4/1.2.3.4/tcp/1/ws")

unSpecQ := ma.StringCast("/ip4/0.0.0.0/udp/2/quic-v1")
unSpecT := ma.StringCast("/ip6/::/tcp/2/")

resolver, err := madns.NewResolver(madns.WithDefaultResolver(&madns.MockResolver{}))
require.NoError(t, err)
s := newTestSwarmWithResolver(t, resolver)
Expand Down Expand Up @@ -307,6 +310,11 @@ func TestAddrsForDialFiltering(t *testing.T) {
input: append([]ma.Multiaddr{q1}, ourAddrs...),
output: []ma.Multiaddr{q1},
},
{
name: "unspecified-filtered",
input: []ma.Multiaddr{q1v1, t1, unSpecQ, unSpecT},
output: []ma.Multiaddr{q1v1, t1},
},
}

ctx := context.Background()
Expand Down

0 comments on commit 2b8f0ce

Please sign in to comment.