Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(907)

Unified Diff: pkg/front_end/test/src/incremental/file_state_test.dart

Issue 2928393004: Add FileState.hasMixin/hasMixinLibrary properties. (Closed)
Patch Set: Tweaks for review comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/lib/src/incremental/file_state.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/src/incremental/file_state_test.dart
diff --git a/pkg/front_end/test/src/incremental/file_state_test.dart b/pkg/front_end/test/src/incremental/file_state_test.dart
index 9e9f391cdbb9f3246d7f021711017fc15b8ad3d5..7232e95bc0ebf78491ab51c13cb13bbe98c37485 100644
--- a/pkg/front_end/test/src/incremental/file_state_test.dart
+++ b/pkg/front_end/test/src/incremental/file_state_test.dart
@@ -284,6 +284,116 @@ export "c.dart" show A, B, C, D hide C show A, D;
}
}
+ test_hasMixinApplication_false() async {
+ writeFile(
+ '/a.dart',
+ r'''
+class A {}
+class B extends Object with A {}
+''');
+ var uri = writeFile(
+ '/test.dart',
+ r'''
+import 'a.dart';
+class T1 extends A {}
+class T2 extends B {}
+''');
+ FileState file = await fsState.getFile(uri);
+ expect(file.hasMixinApplication, isFalse);
+ }
+
+ test_hasMixinApplication_true_class() async {
+ var uri = writeFile(
+ '/test.dart',
+ r'''
+class A {}
+class B extends Object with A {}
+''');
+ FileState file = await fsState.getFile(uri);
+ expect(file.hasMixinApplication, isTrue);
+ }
+
+ test_hasMixinApplication_true_named() async {
+ var uri = writeFile(
+ '/test.dart',
+ r'''
+class A {}
+class B = Object with A;
+''');
+ FileState file = await fsState.getFile(uri);
+ expect(file.hasMixinApplication, isTrue);
+ }
+
+ test_hasMixinApplicationLibrary_false() async {
+ var partUri = writeFile(
+ '/part.dart',
+ r'''
+part of test;
+class A {}
+''');
+ var libUri = writeFile(
+ '/test.dart',
+ r'''
+library test;
+part 'part.dart';
+class B extends A {}
+''');
+
+ FileState part = await fsState.getFile(partUri);
+ FileState lib = await fsState.getFile(libUri);
+
+ expect(part.hasMixinApplication, isFalse);
+ expect(lib.hasMixinApplication, isFalse);
+ expect(lib.hasMixinApplicationLibrary, isFalse);
+ }
+
+ test_hasMixinApplicationLibrary_true_inDefiningUnit() async {
+ var partUri = writeFile(
+ '/part.dart',
+ r'''
+part of test;
+class A {}
+''');
+ var libUri = writeFile(
+ '/test.dart',
+ r'''
+library test;
+part 'part.dart';
+class B extends Object with A {}
+''');
+
+ FileState part = await fsState.getFile(partUri);
+ FileState lib = await fsState.getFile(libUri);
+
+ expect(part.hasMixinApplication, isFalse);
+ expect(lib.hasMixinApplication, isTrue);
+ expect(lib.hasMixinApplicationLibrary, isTrue);
+ }
+
+ test_hasMixinApplicationLibrary_true_inPart() async {
+ var partUri = writeFile(
+ '/part.dart',
+ r'''
+part of test;
+class A {}
+class B extends Object with A {}
+''');
+ var libUri = writeFile(
+ '/test.dart',
+ r'''
+library test;
+part 'part.dart';
+class C {}
+''');
+
+ FileState part = await fsState.getFile(partUri);
+ FileState lib = await fsState.getFile(libUri);
+
+ expect(part.hasMixinApplication, isTrue);
+ expect(lib.hasMixinApplication, isFalse);
+ expect(lib.hasMixinApplicationLibrary, isTrue);
+ }
+
test_newFileListener() async {
var a = writeFile('/a.dart', '');
var b = writeFile('/b.dart', '');
« no previous file with comments | « pkg/front_end/lib/src/incremental/file_state.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698