1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #36455 from thaJeztah/flip-asserts

Fix "expected" and "actual" being reversed
This commit is contained in:
Sebastiaan van Stijn 2018-03-01 21:31:46 +01:00 committed by GitHub
commit 7459e4cd4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ func TestNetworkNat(t *testing.T) {
data, err := ioutil.ReadAll(conn)
require.NoError(t, err)
assert.Equal(t, strings.TrimSpace(string(data)), msg)
assert.Equal(t, msg, strings.TrimSpace(string(data)))
}
func TestNetworkLocalhostTCPNat(t *testing.T) {
@ -53,7 +53,7 @@ func TestNetworkLocalhostTCPNat(t *testing.T) {
data, err := ioutil.ReadAll(conn)
require.NoError(t, err)
assert.Equal(t, strings.TrimSpace(string(data)), msg)
assert.Equal(t, msg, strings.TrimSpace(string(data)))
}
func TestNetworkLoopbackNat(t *testing.T) {
@ -81,7 +81,7 @@ func TestNetworkLoopbackNat(t *testing.T) {
_, err = io.Copy(&b, body)
require.NoError(t, err)
assert.Equal(t, strings.TrimSpace(b.String()), msg)
assert.Equal(t, msg, strings.TrimSpace(b.String()))
}
func startServerContainer(t *testing.T, msg string, port int) string {
@ -109,7 +109,7 @@ func getExternalAddress(t *testing.T) net.IP {
ifaceAddrs, err := iface.Addrs()
require.NoError(t, err)
assert.NotEqual(t, len(ifaceAddrs), 0)
assert.NotEqual(t, 0, len(ifaceAddrs))
ifaceIP, _, err := net.ParseCIDR(ifaceAddrs[0].String())
require.NoError(t, err)