Skip to content

Commit

Permalink
Update test to cover mptcp
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyipanuber committed Aug 21, 2023
1 parent 797c669 commit 88106eb
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,26 @@ func toMap(fields LogFields) map[string]interface{} {
}

func TestNewChannel(t *testing.T) {
ch, err := NewChannel("svc", &ChannelOptions{
ProcessName: "pname",
EnableMPTCP: true,
})
require.NoError(t, err, "NewChannel failed")
assert.Equal(t, LocalPeerInfo{
ServiceName: "svc",
PeerInfo: PeerInfo{
for _, mptcp := range []bool{true, false} {
ch, err := NewChannel("svc", &ChannelOptions{
ProcessName: "pname",
HostPort: ephemeralHostPort,
IsEphemeral: true,
Version: PeerVersion{
Language: "go",
LanguageVersion: strings.TrimPrefix(runtime.Version(), "go"),
TChannelVersion: VersionInfo,
EnableMPTCP: mptcp,
})
require.NoError(t, err, "NewChannel failed")
assert.Equal(t, LocalPeerInfo{
ServiceName: "svc",
PeerInfo: PeerInfo{
ProcessName: "pname",
HostPort: ephemeralHostPort,
IsEphemeral: true,
Version: PeerVersion{
Language: "go",
LanguageVersion: strings.TrimPrefix(runtime.Version(), "go"),
TChannelVersion: VersionInfo,
},
},
},
}, ch.PeerInfo(), "Wrong local peer info")
}, ch.PeerInfo(), "Wrong local peer info")
}
}

func TestLoggers(t *testing.T) {
Expand Down

0 comments on commit 88106eb

Please sign in to comment.