diff --git a/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart b/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart index 1fc97ba20a83..cc104b604777 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart @@ -93,6 +93,52 @@ void f(Stream args) { A.m(); B.m(); } +'''); + } + + Future test_organizePathImports_thatSpanTwoLines() async { + newFile('$testPackageLibPath/a.dart', ''' +class A { + static void m() {} +} +'''); + newFile('$testPackageLibPath/a/b.dart', ''' +class B { + static void m() {} +} +'''); + newFile('$testPackageLibPath/a/c.dart', ''' +class C { + static void m() {} +} +'''); + + await resolveTestCode(''' +import 'dart:async'; +import 'a/b.dart'; +import 'a.dart' + show A; +import 'a/c.dart'; + +void f(Stream args) { + A.m(); + B.m(); + C.m(); +} +'''); + await assertHasFix(''' +import 'dart:async'; + +import 'a.dart' + show A; +import 'a/b.dart'; +import 'a/c.dart'; + +void f(Stream args) { + A.m(); + B.m(); + C.m(); +} '''); } }