This commit is contained in:
Thomas Modeneis 2019-08-13 22:44:48 +02:00
parent 44c8b9ad37
commit af72871185
2 changed files with 6 additions and 6 deletions

View file

@ -27,6 +27,8 @@ import (
"testing/quick"
"time"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
@ -152,10 +154,8 @@ func TestParseNode(t *testing.T) {
if err == nil {
t.Errorf("test %q:\n got nil error, expected %#q", test.rawurl, test.wantError)
continue
} else if err.Error() != test.wantError {
t.Errorf("test %q:\n got error %#q, expected %#q", test.rawurl, err.Error(), test.wantError)
continue
}
require.Contains(t, err.Error(), test.wantError, "test %q:\n got error %#q, expected %#q", test.rawurl, err.Error(), test.wantError)
} else {
if err != nil {
t.Errorf("test %q:\n unexpected error: %v", test.rawurl, err)

View file

@ -23,6 +23,8 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/require"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p/enr"
)
@ -162,10 +164,8 @@ func TestParseNode(t *testing.T) {
if err == nil {
t.Errorf("test %q:\n got nil error, expected %#q", test.input, test.wantError)
continue
} else if err.Error() != test.wantError {
t.Errorf("test %q:\n got error %#q, expected %#q", test.input, err.Error(), test.wantError)
continue
}
require.Contains(t, err.Error(), test.wantError, "test %q:\n got error %#q, expected %#q", test.input, err.Error(), test.wantError)
} else {
if err != nil {
t.Errorf("test %q:\n unexpected error: %v", test.input, err)