Skip to content

Commit

Permalink
Test. Check path in StaticError.matchLocation()
Browse files Browse the repository at this point in the history
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 <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and Commit Queue committed Apr 27, 2024
1 parent 1ff4f72 commit 5b2ea0c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/test_runner/lib/src/static_error.dart
Expand Up @@ -396,6 +396,7 @@ class StaticError implements Comparable<StaticError> {
///
/// 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.
Expand Down

0 comments on commit 5b2ea0c

Please sign in to comment.