mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
fixes #19959
This commit is contained in:
parent
44c8b9ad37
commit
af72871185
2 changed files with 6 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue