Issue 54893: Add a test for sorting imports that span 2 lines.

Change-Id: I9ed0a1b754d3f201d760813dafa4c1049b7124f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
This commit is contained in:
Keerti Parthasarathy 2024-03-28 17:54:51 +00:00 committed by Commit Queue
parent 3b23ffe53f
commit b6137f7cee

View file

@ -93,6 +93,52 @@ void f(Stream<String> args) {
A.m();
B.m();
}
''');
}
Future<void> 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<String> 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<String> args) {
A.m();
B.m();
C.m();
}
''');
}
}