accounts: increase parseURL test coverage (#25033)

accounts/url: add test logic what check null string to parseURL()
This commit is contained in:
Seungbae.yu 2022-06-07 19:46:27 +09:00 committed by GitHub
parent 403624a4a1
commit 450f5da7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,9 +32,10 @@ func TestURLParsing(t *testing.T) {
t.Errorf("expected: %v, got: %v", "ethereum.org", url.Path) t.Errorf("expected: %v, got: %v", "ethereum.org", url.Path)
} }
_, err = parseURL("ethereum.org") for _, u := range []string{"ethereum.org", ""} {
if err == nil { if _, err = parseURL(u); err == nil {
t.Error("expected err, got: nil") t.Errorf("input %v, expected err, got: nil", u)
}
} }
} }