From 5b2ea0c7a227d91c691d2ff8cbbeb5f7f86afdb9 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Sat, 27 Apr 2024 18:07:53 +0000 Subject: [PATCH] Test. Check path in StaticError.matchLocation() This was causing issues with tests when there are two expected errors at the same lines, in different files. The first expected error would (and consume) both actual errors. So, the second expected error would say that is unsatisfied. Change-Id: I0bd7b56d070732c83d1d87f3dcf8ba20a693028c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364604 Reviewed-by: Bob Nystrom Commit-Queue: Konstantin Shcheglov --- pkg/test_runner/lib/src/static_error.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/test_runner/lib/src/static_error.dart b/pkg/test_runner/lib/src/static_error.dart index d1b6da833557..b354b52dd0c1 100644 --- a/pkg/test_runner/lib/src/static_error.dart +++ b/pkg/test_runner/lib/src/static_error.dart @@ -396,6 +396,7 @@ class StaticError implements Comparable { /// /// Takes into account unspecified errors and errors without lengths. bool _matchLocation(StaticError actual) { + if (path != actual.path) return false; if (line != actual.line) return false; // Ignore column and length for unspecified errors.