Exception for error check in accounts/keystore/account_cache_test.go

This commit is contained in:
Quentin Mc Gaw 2025-01-20 09:00:01 +01:00
parent d245d7e868
commit e2ba539edd
No known key found for this signature in database
GPG key ID: 6B26BAFFE648CAFB

View file

@ -307,7 +307,9 @@ func TestCacheFind(t *testing.T) {
}
for i, test := range tests {
a, err := cache.find(test.Query)
if !errors.Is(err, test.WantError) {
if (err == nil && test.WantError != nil) ||
(err != nil && test.WantError == nil) ||
(err != nil && err.Error() != test.WantError.Error()) {
t.Errorf("test %d: error mismatch for query %v\ngot %q\nwant %q", i, test.Query, err, test.WantError)
continue
}