ethclient: improve testing for Version with better error logging

This commit is contained in:
tr1sm0s1n 2025-03-12 17:24:56 +05:30
parent 11c9fda82b
commit 591335f8d3
No known key found for this signature in database
GPG key ID: BC64CB662BFBBFE4

View file

@ -333,8 +333,9 @@ func testVersion(t *testing.T, client *rpc.Client) {
if err != nil { if err != nil {
t.Fatalf("unexpected error: %v", err) t.Fatalf("unexpected error: %v", err)
} }
if v != fmt.Sprintf("%s/%s-%s/%s", strings.TrimSuffix(filepath.Base(os.Args[0]), ".exe"), runtime.GOOS, runtime.GOARCH, runtime.Version()) { exp := fmt.Sprintf("%s/%s-%s/%s", strings.TrimSuffix(filepath.Base(os.Args[0]), ".exe"), runtime.GOOS, runtime.GOARCH, runtime.Version())
t.Fatalf("Version returned wrong value: %s", v) if v != exp {
t.Fatalf("Version returned wrong value: %s, expected: %s", v, exp)
} }
} }