This commit is contained in:
Michael Yang
2025-11-18 14:07:58 -08:00
parent f01c83ed6d
commit 4d24d8a77d
22 changed files with 58 additions and 91 deletions

View File

@@ -326,17 +326,11 @@ MESSAGE system`,
return
}
switch tt.err.(type) {
case *ParserError:
var pErr *ParserError
if errors.As(err, &pErr) {
// got the correct type of error
return
}
}
if errors.Is(err, tt.err) {
return
} else if pErr := (*ParserError)(nil); errors.As(err, &pErr) {
// got the correct type of error
return
}
t.Fatalf("unexpected error: expected: %v, actual: %v", tt.err, err)