Skip to content

Commit c562e61

Browse files
DanTupCommit Queue
authored andcommitted
[analysis_server] Fix expected EOL in integration test on Windows
Fixes #61255 Change-Id: Ifb11a0add0219c93e167cf673a916fa35fafad12 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443804 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]> Auto-Submit: Danny Tuppeny <[email protected]> Reviewed-by: Samuel Rawlins <[email protected]>
1 parent 21f365f commit c562e61

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

pkg/analysis_server/integration_test/edit/import_elements_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ class AnalysisGetImportElementsIntegrationTest
5555
expect(edit.file, expectedFile);
5656
}
5757
var actual = edit.edits;
58+
expect(actual, unorderedEquals(expected));
5859
expect(actual, hasLength(expected.length));
5960
for (var expectedEdit in expected) {
6061
var index = find(actual, expectedEdit);
6162
if (index < 0) {
62-
fail('Expected $expectedEdit; not found');
63+
var actualDescription = actual.map((edit) => ' - $edit').join('\n');
64+
fail('Expected $expectedEdit; not found in:\n$actualDescription');
6365
}
6466
actual.removeAt(index);
6567
}
@@ -96,7 +98,7 @@ class AnalysisGetImportElementsIntegrationTest
9698
<ImportedElements>[
9799
ImportedElements(mathPath, '', <String>['Random']),
98100
],
99-
[SourceEdit(0, 0, "import 'dart:math';\n\n")],
101+
[SourceEdit(0, 0, "import 'dart:math';$eol$eol")],
100102
);
101103
}
102104

pkg/analysis_server/integration_test/support/integration_tests.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import 'package:analysis_server/protocol/protocol_constants.dart';
1111
import 'package:analysis_server/src/protocol_server.dart';
1212
import 'package:analysis_server/src/services/pub/pub_command.dart';
1313
import 'package:analyzer/file_system/physical_file_system.dart';
14+
import 'package:analyzer/src/test_utilities/platform.dart';
1415
import 'package:analyzer/src/util/file_paths.dart' as file_paths;
1516
import 'package:analyzer_testing/mock_packages/mock_packages.dart';
1617
import 'package:analyzer_testing/utilities/utilities.dart';
@@ -176,6 +177,9 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest
176177
return completer.future;
177178
}
178179

180+
/// The line terminator being used for test files and to be expected in edits.
181+
String get eol => testEol;
182+
179183
@override
180184
String get packagesRootPath => packagesDirectory.path;
181185

0 commit comments

Comments
 (0)