[test_runner] Fix static_error_test on Windows.

The path separator in the expect makes it fail; shorten the path, there
is no need for a separator in the test case.

R=whesse@google.com

Change-Id: Ief6078828daa18e1bf552e62ea0d3d4dee70ec84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353400
Reviewed-by: Jonas Termansen <sortie@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
This commit is contained in:
David Morgan 2024-02-21 09:46:42 +00:00 committed by Commit Queue
parent 460e003cac
commit cccde729eb

View file

@ -29,10 +29,10 @@ void testProperties() {
Expect.setEquals({1, 3, 5}, analyzer.sourceLines);
var cfe = StaticError(ErrorSource.cfe, "Error.",
path: '${Directory.current.path}/lib/test.dart', line: 4, column: 5);
path: '${Directory.current.path}/test.dart', line: 4, column: 5);
Expect.equals(cfe.source, ErrorSource.cfe);
Expect.equals(cfe.message, "Error.");
Expect.equals(cfe.path, 'lib/test.dart'); // Current path gets removed.
Expect.equals(cfe.path, 'test.dart'); // Current path gets removed.
Expect.equals(cfe.line, 4);
Expect.equals(cfe.column, 5);
Expect.equals(cfe.length, 0);