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

Side by Side Diff: pkg/analyzer/test/generated/incremental_resolver_test.dart

Issue 1026093002: Fix hints in the analyzer package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 engine.incremental_resolver_test; 5 library engine.incremental_resolver_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
(...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after
3800 void test_scopeFor_MethodDeclaration_body() { 3800 void test_scopeFor_MethodDeclaration_body() {
3801 Scope scope = _scopeFor(_createResolvedMethodDeclaration().body); 3801 Scope scope = _scopeFor(_createResolvedMethodDeclaration().body);
3802 EngineTestCase.assertInstanceOf( 3802 EngineTestCase.assertInstanceOf(
3803 (obj) => obj is FunctionScope, FunctionScope, scope); 3803 (obj) => obj is FunctionScope, FunctionScope, scope);
3804 } 3804 }
3805 3805
3806 void test_scopeFor_notInCompilationUnit() { 3806 void test_scopeFor_notInCompilationUnit() {
3807 try { 3807 try {
3808 _scopeFor(AstFactory.identifier3("x")); 3808 _scopeFor(AstFactory.identifier3("x"));
3809 fail("Expected AnalysisException"); 3809 fail("Expected AnalysisException");
3810 } on AnalysisException catch (exception) { 3810 } on AnalysisException {
3811 // Expected 3811 // Expected
3812 } 3812 }
3813 } 3813 }
3814 3814
3815 void test_scopeFor_null() { 3815 void test_scopeFor_null() {
3816 try { 3816 try {
3817 _scopeFor(null); 3817 _scopeFor(null);
3818 fail("Expected AnalysisException"); 3818 fail("Expected AnalysisException");
3819 } on AnalysisException catch (exception) { 3819 } on AnalysisException {
3820 // Expected 3820 // Expected
3821 } 3821 }
3822 } 3822 }
3823 3823
3824 void test_scopeFor_unresolved() { 3824 void test_scopeFor_unresolved() {
3825 try { 3825 try {
3826 _scopeFor(AstFactory.compilationUnit()); 3826 _scopeFor(AstFactory.compilationUnit());
3827 fail("Expected AnalysisException"); 3827 fail("Expected AnalysisException");
3828 } on AnalysisException catch (exception) { 3828 } on AnalysisException {
3829 // Expected 3829 // Expected
3830 } 3830 }
3831 } 3831 }
3832 3832
3833 ClassDeclaration _createResolvedClassDeclaration() { 3833 ClassDeclaration _createResolvedClassDeclaration() {
3834 CompilationUnit unit = _createResolvedCompilationUnit(); 3834 CompilationUnit unit = _createResolvedCompilationUnit();
3835 String className = "C"; 3835 String className = "C";
3836 ClassDeclaration classNode = AstFactory.classDeclaration( 3836 ClassDeclaration classNode = AstFactory.classDeclaration(
3837 null, className, AstFactory.typeParameterList(), null, null, null); 3837 null, className, AstFactory.typeParameterList(), null, null, null);
3838 unit.declarations.add(classNode); 3838 unit.declarations.add(classNode);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
3932 return ResolutionContextBuilder.contextFor(node, listener).scope; 3932 return ResolutionContextBuilder.contextFor(node, listener).scope;
3933 } 3933 }
3934 } 3934 }
3935 3935
3936 class _Edit { 3936 class _Edit {
3937 final int offset; 3937 final int offset;
3938 final int length; 3938 final int length;
3939 final String replacement; 3939 final String replacement;
3940 _Edit(this.offset, this.length, this.replacement); 3940 _Edit(this.offset, this.length, this.replacement);
3941 } 3941 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/engine_test.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698