OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// General equivalence test functions. | 5 /// General equivalence test functions. |
6 | 6 |
7 library dart2js.equivalence.helpers; | 7 library dart2js.equivalence.helpers; |
8 | 8 |
9 import 'package:compiler/src/constants/expressions.dart'; | 9 import 'package:compiler/src/constants/expressions.dart'; |
10 import 'package:compiler/src/constants/values.dart'; | 10 import 'package:compiler/src/constants/values.dart'; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 return sb.toString(); | 48 return sb.toString(); |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 /// Strategy for checking equivalence. | 52 /// Strategy for checking equivalence. |
53 /// | 53 /// |
54 /// Use this strategy to fail early with contextual information in the event of | 54 /// Use this strategy to fail early with contextual information in the event of |
55 /// inequivalence. | 55 /// inequivalence. |
56 class CheckStrategy extends TestStrategy { | 56 class CheckStrategy extends TestStrategy { |
57 const CheckStrategy( | 57 const CheckStrategy( |
58 {Equivalence<Entity> elementEquivalence: areElementsEquivalent, | 58 {Equivalence<Entity> elementEquivalence: areEntitiesEquivalent, |
59 Equivalence<DartType> typeEquivalence: areTypesEquivalent, | 59 Equivalence<DartType> typeEquivalence: areTypesEquivalent, |
60 Equivalence<ConstantExpression> constantEquivalence: | 60 Equivalence<ConstantExpression> constantEquivalence: |
61 areConstantsEquivalent, | 61 areConstantsEquivalent, |
62 Equivalence<ConstantValue> constantValueEquivalence: | 62 Equivalence<ConstantValue> constantValueEquivalence: |
63 areConstantValuesEquivalent}) | 63 areConstantValuesEquivalent}) |
64 : super( | 64 : super( |
65 elementEquivalence: elementEquivalence, | 65 elementEquivalence: elementEquivalence, |
66 typeEquivalence: typeEquivalence, | 66 typeEquivalence: typeEquivalence, |
67 constantEquivalence: constantEquivalence, | 67 constantEquivalence: constantEquivalence, |
68 constantValueEquivalence: constantValueEquivalence); | 68 constantValueEquivalence: constantValueEquivalence); |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 (mismatch.isNotEmpty && failOnMismatch) || | 476 (mismatch.isNotEmpty && failOnMismatch) || |
477 remaining.isNotEmpty) { | 477 remaining.isNotEmpty) { |
478 Expect.fail(message); | 478 Expect.fail(message); |
479 } else { | 479 } else { |
480 print(message); | 480 print(message); |
481 } | 481 } |
482 } else if (verbose) { | 482 } else if (verbose) { |
483 print(message); | 483 print(message); |
484 } | 484 } |
485 } | 485 } |
OLD | NEW |