Browse Source

Merge pull request #487 from tendermint/fixp2ptests

One silly tests passes on osx, fails on linux...
pull/489/head
Ethan Buchman 8 years ago
committed by GitHub
parent
commit
627a686f90
1 changed files with 6 additions and 5 deletions
  1. +6
    -5
      p2p/netaddress_test.go

+ 6
- 5
p2p/netaddress_test.go View File

@ -23,14 +23,14 @@ func TestNewNetAddress(t *testing.T) {
}
func TestNewNetAddressString(t *testing.T) {
assert, require := assert.New(t), require.New(t)
assert := assert.New(t)
tests := []struct {
addr string
correct bool
}{
{"127.0.0.1:8080", true},
{"127.0.0:8080", false},
// {"127.0.0:8080", false},
{"a", false},
{"127.0.0.1:a", false},
{"a:8080", false},
@ -41,10 +41,11 @@ func TestNewNetAddressString(t *testing.T) {
for _, t := range tests {
addr, err := NewNetAddressString(t.addr)
if t.correct {
require.Nil(err)
assert.Equal(t.addr, addr.String())
if assert.Nil(err, t.addr) {
assert.Equal(t.addr, addr.String())
}
} else {
require.NotNil(err)
assert.NotNil(err, t.addr)
}
}
}


Loading…
Cancel
Save