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

Unified Diff: tests/compiler/dart2js/type_combination_test.dart

Issue 1413613010: Normalize type masks to use the least upper instantiated subclass/type. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix try/poi Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/patch_test.dart ('k') | tests/compiler/dart2js/type_mask2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/type_combination_test.dart
diff --git a/tests/compiler/dart2js/type_combination_test.dart b/tests/compiler/dart2js/type_combination_test.dart
index 17af7f41efbacee4eeeb1d4d19f4c792463a4481..3aef5f82eb98e0381bfcd22367aefade83dbc369 100644
--- a/tests/compiler/dart2js/type_combination_test.dart
+++ b/tests/compiler/dart2js/type_combination_test.dart
@@ -76,8 +76,9 @@ class RuleSet {
var r1 = operate(type1, type2);
var r2 = operate(type2, type1);
- Expect.equals(result, r1);
- Expect.equals(r1, r2, 'symmetry violation');
+ Expect.equals(result, r1,
+ "Unexpected result of $name($type1,$type2)");
+ Expect.equals(r1, r2, 'Symmetry violation of $name($type1,$type2)');
}
void check(type1, type2, predicate) {
@@ -731,7 +732,11 @@ void testRegressions(MockCompiler compiler) {
}
void main() {
- asyncTest(() => MockCompiler.create((MockCompiler compiler) {
+ asyncTest(() async {
+ MockCompiler compiler = new MockCompiler.internal();
+ await compiler.init("""
+ class PatternImpl implements Pattern {}
+ """);
JavaScriptBackend backend = compiler.backend;
BackendHelpers helpers = backend.helpers;
World world = compiler.world;
@@ -744,6 +749,9 @@ void main() {
compiler.globalDependencies);
}
});
+ ClassElement patternImplClass = compiler.mainApp.find('PatternImpl');
+ patternImplClass.ensureResolved(compiler.resolution);
+
backend.registerInstantiatedType(
compiler.coreTypes.mapType(),
compiler.enqueuer.resolution,
@@ -752,6 +760,10 @@ void main() {
compiler.coreTypes.functionType,
compiler.enqueuer.resolution,
compiler.globalDependencies);
+ backend.registerInstantiatedType(
+ patternImplClass.rawType,
+ compiler.enqueuer.resolution,
+ compiler.globalDependencies);
compiler.world.populate();
// Grab hold of a supertype for String so we can produce potential
@@ -805,8 +817,15 @@ void main() {
dynamicType = new TypeMask.subclass(
compiler.coreClasses.objectClass, world);
+ Expect.notEquals(emptyType, nonPrimitive1,
+ "nonPrimitive1 expected to be non-empty.");
+ Expect.notEquals(jsStringOrNull, potentialString,
+ "potentialString expected not to be exact JSString");
+ Expect.notEquals(jsArrayOrNull, potentialArray,
+ "potentialArray expected not to be JSArray subclass");
+
testUnion(compiler);
testIntersection(compiler);
testRegressions(compiler);
- }));
+ });
}
« no previous file with comments | « tests/compiler/dart2js/patch_test.dart ('k') | tests/compiler/dart2js/type_mask2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698