Skip to content

Commit

Permalink
[enhanced parts] test for prefer_relative_imports
Browse files Browse the repository at this point in the history
Fixes: dart-lang/linter#5083

Change-Id: I3bc7715b77e3e96a45e95d896865f20f859cc8e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382904
Commit-Queue: Phil Quitslund <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
  • Loading branch information
pq authored and Commit Queue committed Aug 30, 2024
1 parent 48ce30a commit b6fa240
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/linter/test/rules/prefer_relative_imports_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ import 'package:test/lib.dart';
await assertNoDiagnosticsIn(result.errors);
}

test_samePackage_packageSchema_inPart() async {
newFile('$testPackageLibPath/lib.dart', r'''
class C {}
''');

newFile('$testPackageRootPath/test/a.dart', r'''
part 'test.dart';
''');

await assertDiagnostics(r'''
part of 'a.dart';
/// This provides [C].
import 'package:test/lib.dart';
''', [
lint(49, 23),
]);
}

test_samePackage_relativeUri() async {
newFile('$testPackageLibPath/lib.dart', r'''
class C {}
Expand Down

0 comments on commit b6fa240

Please sign in to comment.