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

Side by Side Diff: pkg/analyzer/test/src/summary/summary_test.dart

Issue 1537223002: Clear 'referenceMap' before summarizing a new unit. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add a new test_all file. Created 5 years 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.summary.summary_test; 5 library analyzer.test.src.summary.summary_test;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/src/generated/engine.dart'; 8 import 'package:analyzer/src/generated/engine.dart';
9 import 'package:analyzer/src/generated/java_engine_io.dart'; 9 import 'package:analyzer/src/generated/java_engine_io.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 expectedTargetUnit: 1); 1996 expectedTargetUnit: 1);
1997 } 1997 }
1998 1998
1999 test_type_reference_to_nonexistent_file_via_prefix() { 1999 test_type_reference_to_nonexistent_file_via_prefix() {
2000 UnlinkedTypeRef typeRef = serializeTypeText('p.C', 2000 UnlinkedTypeRef typeRef = serializeTypeText('p.C',
2001 otherDeclarations: 'import "foo.dart" as p;', allowErrors: true); 2001 otherDeclarations: 'import "foo.dart" as p;', allowErrors: true);
2002 checkUnresolvedTypeRef(typeRef, 'p', 'C'); 2002 checkUnresolvedTypeRef(typeRef, 'p', 'C');
2003 } 2003 }
2004 2004
2005 test_type_reference_to_part() { 2005 test_type_reference_to_part() {
2006 addNamedSource('/a.dart', 'part of foo; class C {}'); 2006 addNamedSource('/a.dart', 'part of foo; class C { C(); }');
2007 checkTypeRef( 2007 serializeLibraryText('library foo; part "a.dart"; C c;');
2008 serializeTypeText('C', 2008 UnlinkedClass classA = findClass('C', unit: unlinkedUnits[1]);
2009 otherDeclarations: 'library foo; part "a.dart";'), 2009 checkTypeRef(classA.executables.single.returnType, null, null, 'C',
2010 null,
2011 null,
2012 'C',
2013 expectedKind: PrelinkedReferenceKind.classOrEnum, 2010 expectedKind: PrelinkedReferenceKind.classOrEnum,
2014 expectedTargetUnit: 1); 2011 expectedTargetUnit: 1,
2012 prelinkedSourceUnit: prelinked.units[1],
2013 unlinkedSourceUnit: unlinkedUnits[1]);
2015 } 2014 }
2016 2015
2017 test_type_reference_to_typedef() { 2016 test_type_reference_to_typedef() {
2018 checkTypeRef(serializeTypeText('F', otherDeclarations: 'typedef void F();'), 2017 checkTypeRef(serializeTypeText('F', otherDeclarations: 'typedef void F();'),
2019 null, null, 'F', 2018 null, null, 'F',
2020 expectedKind: PrelinkedReferenceKind.typedef); 2019 expectedKind: PrelinkedReferenceKind.typedef);
2021 } 2020 }
2022 2021
2023 test_type_unit_counts_unreferenced_units() { 2022 test_type_unit_counts_unreferenced_units() {
2024 addNamedSource('/a.dart', 'library a; part "b.dart"; part "c.dart";'); 2023 addNamedSource('/a.dart', 'library a; part "b.dart"; part "c.dart";');
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 serializeClassText('class C { static int i; }').fields[0]; 2155 serializeClassText('class C { static int i; }').fields[0];
2157 expect(variable.isStatic, isTrue); 2156 expect(variable.isStatic, isTrue);
2158 } 2157 }
2159 2158
2160 test_variable_type() { 2159 test_variable_type() {
2161 UnlinkedVariable variable = 2160 UnlinkedVariable variable =
2162 serializeVariableText('int i;', variableName: 'i'); 2161 serializeVariableText('int i;', variableName: 'i');
2163 checkTypeRef(variable.type, 'dart:core', 'dart:core', 'int'); 2162 checkTypeRef(variable.type, 'dart:core', 'dart:core', 'int');
2164 } 2163 }
2165 } 2164 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/test/src/summary/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698