core: fix error message in test

This commit is contained in:
Zach Brown 2025-09-30 18:48:38 +08:00 committed by GitHub
parent 2037c53e7a
commit b7b1889408
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -389,7 +389,7 @@ func TestFreezerCloseSync(t *testing.T) {
if err := f.SyncAncient(); err == nil { if err := f.SyncAncient(); err == nil {
t.Fatalf("want error, have nil") t.Fatalf("want error, have nil")
} else if have, want := err.Error(), "[closed closed]"; have != want { } 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)
} }
} }

View file

@ -1190,10 +1190,10 @@ func TestStateDBAccessList(t *testing.T) {
verifyAddrs("aa", "bb") verifyAddrs("aa", "bb")
verifySlots("bb", "01", "02") verifySlots("bb", "01", "02")
if got, exp := len(state.accessList.addresses), 2; got != exp { 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 { if got, exp := len(state.accessList.slots), 1; got != exp {
t.Fatalf("expected empty, got %d", got) t.Fatalf("expected 1, got %d", got)
} }
} }

View file

@ -1064,7 +1064,7 @@ func TestQueueTimeLimiting(t *testing.T) {
t.Fatalf("pending transactions mismatched: have %d, want %d", pending, 0) t.Fatalf("pending transactions mismatched: have %d, want %d", pending, 0)
} }
if queued != 1 { 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 { if err := validatePoolInternals(pool); err != nil {
t.Fatalf("pool internal state corrupted: %v", err) 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) t.Fatalf("pending transactions mismatched: have %d, want %d", pending, 0)
} }
if queued != 1 { 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 { if err := validatePoolInternals(pool); err != nil {
t.Fatalf("pool internal state corrupted: %v", err) t.Fatalf("pool internal state corrupted: %v", err)
@ -1904,7 +1904,7 @@ func TestDualHeapEviction(t *testing.T) {
} }
pending, queued := pool.Stats() pending, queued := pool.Stats()
if pending+queued != 20 { 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)
} }
} }