OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.test.src.context.context_test; | 5 library analyzer.test.src.context.context_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 List<AnalysisError> errors = context.computeErrors(source); | 759 List<AnalysisError> errors = context.computeErrors(source); |
760 expect(errors, hasLength(0)); | 760 expect(errors, hasLength(0)); |
761 } | 761 } |
762 | 762 |
763 void test_computeErrors_dart_part() { | 763 void test_computeErrors_dart_part() { |
764 Source librarySource = | 764 Source librarySource = |
765 addSource("/lib.dart", "library lib; part 'part.dart';"); | 765 addSource("/lib.dart", "library lib; part 'part.dart';"); |
766 Source partSource = addSource("/part.dart", "part of 'lib';"); | 766 Source partSource = addSource("/part.dart", "part of 'lib';"); |
767 context.parseCompilationUnit(librarySource); | 767 context.parseCompilationUnit(librarySource); |
768 List<AnalysisError> errors = context.computeErrors(partSource); | 768 List<AnalysisError> errors = context.computeErrors(partSource); |
769 expect(errors, isNotNull); | 769 if (context.analysisOptions.enableUriInPartOf) { |
770 expect(errors.length > 0, isTrue); | 770 // TODO(28522) |
| 771 // Should report that 'lib' isn't the correct URI. |
| 772 } else { |
| 773 expect(errors, isNotNull); |
| 774 expect(errors.length > 0, isTrue); |
| 775 } |
771 } | 776 } |
772 | 777 |
773 void test_computeErrors_dart_some() { | 778 void test_computeErrors_dart_some() { |
774 Source source = addSource("/lib.dart", "library 'lib';"); | 779 Source source = addSource("/lib.dart", "library 'lib';"); |
775 List<AnalysisError> errors = context.computeErrors(source); | 780 List<AnalysisError> errors = context.computeErrors(source); |
776 expect(errors, isNotNull); | 781 expect(errors, isNotNull); |
777 expect(errors.length > 0, isTrue); | 782 expect(errors.length > 0, isTrue); |
778 } | 783 } |
779 | 784 |
780 void test_computeErrors_html_none() { | 785 void test_computeErrors_html_none() { |
(...skipping 4659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5440 * Initialize the visitor. | 5445 * Initialize the visitor. |
5441 */ | 5446 */ |
5442 _ElementGatherer(); | 5447 _ElementGatherer(); |
5443 | 5448 |
5444 @override | 5449 @override |
5445 void visitElement(Element element) { | 5450 void visitElement(Element element) { |
5446 elements[element] = element; | 5451 elements[element] = element; |
5447 super.visitElement(element); | 5452 super.visitElement(element); |
5448 } | 5453 } |
5449 } | 5454 } |
OLD | NEW |