From 88106ebf05fa15f0b1331a77bb7cd9cc357abe1a Mon Sep 17 00:00:00 2001 From: Zhiyi Pan Date: Mon, 21 Aug 2023 15:46:05 -0700 Subject: [PATCH] Update test to cover mptcp --- channel_test.go | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/channel_test.go b/channel_test.go index 728f12f4..a91fdde6 100644 --- a/channel_test.go +++ b/channel_test.go @@ -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) {