ethclient: fix testing for Version in Windows

This commit is contained in:
tr1sm0s1n 2025-03-10 18:13:54 +05:30
parent 406325a50c
commit 11c9fda82b
No known key found for this signature in database
GPG key ID: BC64CB662BFBBFE4

View file

@ -26,6 +26,7 @@ import (
"path/filepath" "path/filepath"
"reflect" "reflect"
"runtime" "runtime"
"strings"
"testing" "testing"
"time" "time"
@ -332,7 +333,7 @@ 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", filepath.Base(os.Args[0]), runtime.GOOS, runtime.GOARCH, runtime.Version()) { if v != 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) t.Fatalf("Version returned wrong value: %s", v)
} }
} }