diff --git a/pkg/analysis_server/integration_test/edit/import_elements_test.dart b/pkg/analysis_server/integration_test/edit/import_elements_test.dart index 8bf2d14fe9a..b2af1cf8695 100644 --- a/pkg/analysis_server/integration_test/edit/import_elements_test.dart +++ b/pkg/analysis_server/integration_test/edit/import_elements_test.dart @@ -55,11 +55,13 @@ class AnalysisGetImportElementsIntegrationTest expect(edit.file, expectedFile); } var actual = edit.edits; + expect(actual, unorderedEquals(expected)); expect(actual, hasLength(expected.length)); for (var expectedEdit in expected) { var index = find(actual, expectedEdit); if (index < 0) { - fail('Expected $expectedEdit; not found'); + var actualDescription = actual.map((edit) => ' - $edit').join('\n'); + fail('Expected $expectedEdit; not found in:\n$actualDescription'); } actual.removeAt(index); } @@ -96,7 +98,7 @@ class AnalysisGetImportElementsIntegrationTest [ ImportedElements(mathPath, '', ['Random']), ], - [SourceEdit(0, 0, "import 'dart:math';\n\n")], + [SourceEdit(0, 0, "import 'dart:math';$eol$eol")], ); } diff --git a/pkg/analysis_server/integration_test/support/integration_tests.dart b/pkg/analysis_server/integration_test/support/integration_tests.dart index 6592262d48c..7fb5cc24365 100644 --- a/pkg/analysis_server/integration_test/support/integration_tests.dart +++ b/pkg/analysis_server/integration_test/support/integration_tests.dart @@ -11,6 +11,7 @@ import 'package:analysis_server/protocol/protocol_constants.dart'; import 'package:analysis_server/src/protocol_server.dart'; import 'package:analysis_server/src/services/pub/pub_command.dart'; import 'package:analyzer/file_system/physical_file_system.dart'; +import 'package:analyzer/src/test_utilities/platform.dart'; import 'package:analyzer/src/util/file_paths.dart' as file_paths; import 'package:analyzer_testing/mock_packages/mock_packages.dart'; import 'package:analyzer_testing/utilities/utilities.dart'; @@ -176,6 +177,9 @@ abstract class AbstractAnalysisServerIntegrationTest extends IntegrationTest return completer.future; } + /// The line terminator being used for test files and to be expected in edits. + String get eol => testEol; + @override String get packagesRootPath => packagesDirectory.path;