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

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

Issue 2648323002: Replace more same(type) with equal(type). (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.generated.resolver_test_case; 5 library analyzer.test.generated.resolver_test_case;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 verify([source]); 468 verify([source]);
469 } 469 }
470 470
471 /** 471 /**
472 * @param code the code that assigns the value to the variable "v", no matter how. We check that 472 * @param code the code that assigns the value to the variable "v", no matter how. We check that
473 * "v" has expected static and propagated type. 473 * "v" has expected static and propagated type.
474 */ 474 */
475 Future<Null> assertPropagatedAssignedType(String code, 475 Future<Null> assertPropagatedAssignedType(String code,
476 DartType expectedStaticType, DartType expectedPropagatedType) async { 476 DartType expectedStaticType, DartType expectedPropagatedType) async {
477 SimpleIdentifier identifier = await findMarkedIdentifier(code, "v = "); 477 SimpleIdentifier identifier = await findMarkedIdentifier(code, "v = ");
478 expect(identifier.staticType, same(expectedStaticType)); 478 expect(identifier.staticType, expectedStaticType);
479 expect(identifier.propagatedType, same(expectedPropagatedType)); 479 expect(identifier.propagatedType, expectedPropagatedType);
480 } 480 }
481 481
482 /** 482 /**
483 * @param code the code that iterates using variable "v". We check that 483 * @param code the code that iterates using variable "v". We check that
484 * "v" has expected static and propagated type. 484 * "v" has expected static and propagated type.
485 */ 485 */
486 Future<Null> assertPropagatedIterationType(String code, 486 Future<Null> assertPropagatedIterationType(String code,
487 DartType expectedStaticType, DartType expectedPropagatedType) async { 487 DartType expectedStaticType, DartType expectedPropagatedType) async {
488 SimpleIdentifier identifier = await findMarkedIdentifier(code, "v in "); 488 SimpleIdentifier identifier = await findMarkedIdentifier(code, "v in ");
489 expect(identifier.staticType, same(expectedStaticType)); 489 expect(identifier.staticType, expectedStaticType);
490 expect(identifier.propagatedType, same(expectedPropagatedType)); 490 expect(identifier.propagatedType, expectedPropagatedType);
491 } 491 }
492 492
493 /** 493 /**
494 * Check the static and propagated types of the expression marked with "; // m arker" comment. 494 * Check the static and propagated types of the expression marked with "; // m arker" comment.
495 * 495 *
496 * @param code source code to analyze, with the expression to check marked wit h "// marker". 496 * @param code source code to analyze, with the expression to check marked wit h "// marker".
497 * @param expectedStaticType if non-null, check actual static type is equal to this. 497 * @param expectedStaticType if non-null, check actual static type is equal to this.
498 * @param expectedPropagatedType if non-null, check actual static type is equa l to this. 498 * @param expectedPropagatedType if non-null, check actual static type is equa l to this.
499 * @throws Exception 499 * @throws Exception
500 */ 500 */
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 } 936 }
937 } 937 }
938 } 938 }
939 939
940 class TestAnalysisResult { 940 class TestAnalysisResult {
941 final Source source; 941 final Source source;
942 final CompilationUnit unit; 942 final CompilationUnit unit;
943 final List<AnalysisError> errors; 943 final List<AnalysisError> errors;
944 TestAnalysisResult(this.source, this.unit, this.errors); 944 TestAnalysisResult(this.source, this.unit, this.errors);
945 } 945 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698