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

Unified Diff: pkg/analyzer/test/src/summary/linker_test.dart

Issue 1983153002: Change ClassElementForLink.getContainedName() to include non-static members. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/linker_test.dart
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index 1d63571934673a18e13cac2939ecc27fa629e28c..34b31ba83a32b9f83e26905ddddf2618c8db5090 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -24,6 +24,8 @@ class LinkerUnitTest extends SummaryLinkerTest {
@override
bool get allowMissingFiles => false;
+ Matcher get isUndefined => new isInstanceOf<UndefinedElementForLink>();
+
LibraryElementInBuildUnit get testLibrary => _testLibrary ??=
linker.getLibrary(linkerInputs.testDartUri) as LibraryElementInBuildUnit;
@@ -150,6 +152,34 @@ const x = [const C()];
expect(classC.unnamedConstructor.isCycleFree, false);
}
+ void test_getContainedName_nonStaticField() {
+ createLinker('class C { var f; }');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ ClassElementForLink_Class c = library.getContainedName('C');
+ expect(c.getContainedName('f'), isNot(isUndefined));
+ }
+
+ void test_getContainedName_nonStaticGetter() {
+ createLinker('class C { get g => null; }');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ ClassElementForLink_Class c = library.getContainedName('C');
+ expect(c.getContainedName('g'), isNot(isUndefined));
+ }
+
+ void test_getContainedName_nonStaticMethod() {
+ createLinker('class C { m() {} }');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ ClassElementForLink_Class c = library.getContainedName('C');
+ expect(c.getContainedName('m'), isNot(isUndefined));
+ }
+
+ void test_getContainedName_nonStaticSetter() {
+ createLinker('class C { void set s(value) {} }');
+ LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
+ ClassElementForLink_Class c = library.getContainedName('C');
+ expect(c.getContainedName('s='), isNot(isUndefined));
+ }
+
void test_inferredType_closure_fromBundle() {
var bundle = createPackageBundle(
'''
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698