Skip to content

Commit

Permalink
update test to anticipate verifying augmentations
Browse files Browse the repository at this point in the history
Change-Id: I9866d05f6a503e3a3b030d6c27173fe6aa61d9e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/366064
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
pq authored and Commit Queue committed May 13, 2024
1 parent a9c2f1b commit b550c3f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkg/linter/test/rules/use_enums_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class UseEnumsTest extends LintRuleTest {
String get lintRule => 'use_enums';

test_augmentation() async {
newFile('$testPackageLibPath/a.dart', r'''
import augment 'test.dart';
var a = newFile('$testPackageLibPath/a.dart', r'''
import augment 'b.dart';
class C {}
''');

await assertNoDiagnostics(r'''
var b = newFile('$testPackageLibPath/b.dart', r'''
augment library 'a.dart';
augment class C {
Expand All @@ -34,6 +34,15 @@ augment class C {
const C._(this.i);
}
''');

result = await resolveFile(a.path);
await assertDiagnosticsIn(errors, [
// TODO(pq): update when augmentation contributed fields are considered.
// See: https://github.com/dart-lang/linter/issues/4900
]);

result = await resolveFile(b.path);
await assertNoDiagnosticsIn(errors);
}

test_constructor_private() async {
Expand Down

0 comments on commit b550c3f

Please sign in to comment.