From b7b18894086f0d90d1677378f06b8c53eba3145d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 30 Sep 2025 18:48:38 +0800 Subject: [PATCH] core: fix error message in test --- core/rawdb/freezer_test.go | 2 +- core/state/statedb_test.go | 4 ++-- core/txpool/legacypool/legacypool_test.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/rawdb/freezer_test.go b/core/rawdb/freezer_test.go index fab3319a2a..419df3d1e2 100644 --- a/core/rawdb/freezer_test.go +++ b/core/rawdb/freezer_test.go @@ -389,7 +389,7 @@ func TestFreezerCloseSync(t *testing.T) { if err := f.SyncAncient(); err == nil { t.Fatalf("want error, have nil") } else if have, want := err.Error(), "[closed closed]"; have != want { - t.Fatalf("want %v, have %v", have, want) + t.Fatalf("want %v, have %v", want, have) } } diff --git a/core/state/statedb_test.go b/core/state/statedb_test.go index 661d17bb7b..17a1329992 100644 --- a/core/state/statedb_test.go +++ b/core/state/statedb_test.go @@ -1190,10 +1190,10 @@ func TestStateDBAccessList(t *testing.T) { verifyAddrs("aa", "bb") verifySlots("bb", "01", "02") if got, exp := len(state.accessList.addresses), 2; got != exp { - t.Fatalf("expected empty, got %d", got) + t.Fatalf("expected 2, got %d", got) } if got, exp := len(state.accessList.slots), 1; got != exp { - t.Fatalf("expected empty, got %d", got) + t.Fatalf("expected 1, got %d", got) } } diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index 0c8642659d..14f63eeb04 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -1064,7 +1064,7 @@ func TestQueueTimeLimiting(t *testing.T) { t.Fatalf("pending transactions mismatched: have %d, want %d", pending, 0) } if queued != 1 { - t.Fatalf("queued transactions mismatched: have %d, want %d", queued, 2) + t.Fatalf("queued transactions mismatched: have %d, want %d", queued, 1) } if err := validatePoolInternals(pool); err != nil { t.Fatalf("pool internal state corrupted: %v", err) @@ -1079,7 +1079,7 @@ func TestQueueTimeLimiting(t *testing.T) { t.Fatalf("pending transactions mismatched: have %d, want %d", pending, 0) } if queued != 1 { - t.Fatalf("queued transactions mismatched: have %d, want %d", queued, 2) + t.Fatalf("queued transactions mismatched: have %d, want %d", queued, 1) } if err := validatePoolInternals(pool); err != nil { t.Fatalf("pool internal state corrupted: %v", err) @@ -1904,7 +1904,7 @@ func TestDualHeapEviction(t *testing.T) { } pending, queued := pool.Stats() if pending+queued != 20 { - t.Fatalf("transaction count mismatch: have %d, want %d", pending+queued, 10) + t.Fatalf("transaction count mismatch: have %d, want %d", pending+queued, 20) } }