| Index: pkg/analyzer/test/generated/resolver_test.dart
|
| diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
|
| index 11eee0be474ebcd0234f35c4e42aff557bb072db..102956ae860a7fdacc0d565196d82cb2b2a17888 100644
|
| --- a/pkg/analyzer/test/generated/resolver_test.dart
|
| +++ b/pkg/analyzer/test/generated/resolver_test.dart
|
| @@ -42,6 +42,7 @@ main() {
|
| runReflectiveTests(ErrorResolverTest);
|
| runReflectiveTests(LibraryImportScopeTest);
|
| runReflectiveTests(LibraryScopeTest);
|
| + runReflectiveTests(PrefixedNamespaceTest);
|
| runReflectiveTests(ScopeTest);
|
| runReflectiveTests(StrictModeTest);
|
| runReflectiveTests(SubtypeManagerTest);
|
| @@ -535,6 +536,35 @@ class LibraryScopeTest extends ResolverTestCase {
|
| }
|
| }
|
|
|
| +@reflectiveTest
|
| +class PrefixedNamespaceTest extends ResolverTestCase {
|
| + void test_lookup_missing() {
|
| + ClassElement element = ElementFactory.classElement2('A');
|
| + PrefixedNamespace namespace = new PrefixedNamespace('p', _toMap([element]));
|
| + expect(namespace.get('p.B'), isNull);
|
| + }
|
| +
|
| + void test_lookup_missing_matchesPrefix() {
|
| + ClassElement element = ElementFactory.classElement2('A');
|
| + PrefixedNamespace namespace = new PrefixedNamespace('p', _toMap([element]));
|
| + expect(namespace.get('p'), isNull);
|
| + }
|
| +
|
| + void test_lookup_valid() {
|
| + ClassElement element = ElementFactory.classElement2('A');
|
| + PrefixedNamespace namespace = new PrefixedNamespace('p', _toMap([element]));
|
| + expect(namespace.get('p.A'), same(element));
|
| + }
|
| +
|
| + HashMap<String, Element> _toMap(List<Element> elements) {
|
| + HashMap<String, Element> map = new HashMap<String, Element>();
|
| + for (Element element in elements) {
|
| + map[element.name] = element;
|
| + }
|
| + return map;
|
| + }
|
| +}
|
| +
|
| class Scope_EnclosedScopeTest_test_define_duplicate extends Scope {
|
| GatheringErrorListener listener;
|
|
|
|
|