Skip to content

Commit

Permalink
Issue 54893: Add a test for sorting imports that span 2 lines.
Browse files Browse the repository at this point in the history
Change-Id: I9ed0a1b754d3f201d760813dafa4c1049b7124f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360280
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Keerti Parthasarathy <[email protected]>
  • Loading branch information
keertip authored and Commit Queue committed Mar 28, 2024
1 parent 3b23ffe commit b6137f7
Showing 1 changed file with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
''');
}
}

0 comments on commit b6137f7

Please sign in to comment.