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

Side by Side Diff: tests/compiler/dart2js/resolver_test.dart

Issue 206193002: Remove cancel and make crash exit with code 253. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 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
« no previous file with comments | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js/unparser2_test.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:async'; 6 import 'dart:async';
7 import "package:async_helper/async_helper.dart"; 7 import "package:async_helper/async_helper.dart";
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution .dart"; 10 import "../../../sdk/lib/_internal/compiler/implementation/resolution/resolution .dart";
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 compiler = new MockCompiler(); 110 compiler = new MockCompiler();
111 compiler.parseScript(""" 111 compiler.parseScript("""
112 class X<T> {} 112 class X<T> {}
113 class Foo extends X<Foo> {} 113 class Foo extends X<Foo> {}
114 class Bar extends Foo implements X<Bar> {} 114 class Bar extends Foo implements X<Bar> {}
115 """); 115 """);
116 compiler.resolveStatement("Bar bar;"); 116 compiler.resolveStatement("Bar bar;");
117 ClassElement classBar = compiler.mainApp.find("Bar"); 117 ClassElement classBar = compiler.mainApp.find("Bar");
118 Expect.equals(0, compiler.warnings.length); 118 Expect.equals(0, compiler.warnings.length);
119 Expect.equals(0, compiler.errors.length); 119 Expect.equals(1, compiler.errors.length);
120 Expect.equals(1, compiler.crashes.length);
121 Expect.equals(MessageKind.MULTI_INHERITANCE, 120 Expect.equals(MessageKind.MULTI_INHERITANCE,
122 compiler.crashes[0].message.kind); 121 compiler.errors[0].message.kind);
122 Expect.equals(0, compiler.crashes.length);
123 } 123 }
124 124
125 testTypeVariables() { 125 testTypeVariables() {
126 matchResolvedTypes(visitor, text, name, expectedElements) { 126 matchResolvedTypes(visitor, text, name, expectedElements) {
127 VariableDefinitions definition = parseStatement(text); 127 VariableDefinitions definition = parseStatement(text);
128 visitor.visit(definition.type); 128 visitor.visit(definition.type);
129 InterfaceType type = visitor.mapping.getType(definition.type); 129 InterfaceType type = visitor.mapping.getType(definition.type);
130 Expect.equals(definition.type.typeArguments.slowLength(), 130 Expect.equals(definition.type.typeArguments.slowLength(),
131 length(type.typeArguments)); 131 length(type.typeArguments));
132 int index = 0; 132 int index = 0;
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 Expect.equals(<String>['A<E>', 'D', 'Object'].toString(), 747 Expect.equals(<String>['A<E>', 'D', 'Object'].toString(),
748 asSortedStrings(supertypes).toString()); 748 asSortedStrings(supertypes).toString());
749 749
750 compiler = new MockCompiler(); 750 compiler = new MockCompiler();
751 compiler.parseScript("""class A<T> {} 751 compiler.parseScript("""class A<T> {}
752 class D extends A<int> implements A<double> {} 752 class D extends A<int> implements A<double> {}
753 main() { return new D(); }"""); 753 main() { return new D(); }""");
754 mainElement = compiler.mainApp.find(MAIN); 754 mainElement = compiler.mainApp.find(MAIN);
755 compiler.resolver.resolve(mainElement); 755 compiler.resolver.resolve(mainElement);
756 Expect.equals(0, compiler.warnings.length); 756 Expect.equals(0, compiler.warnings.length);
757 Expect.equals(0, compiler.errors.length); 757 Expect.equals(1, compiler.errors.length);
758 Expect.equals(1, compiler.crashes.length);
759 Expect.equals(MessageKind.MULTI_INHERITANCE, 758 Expect.equals(MessageKind.MULTI_INHERITANCE,
760 compiler.crashes[0].message.kind); 759 compiler.errors[0].message.kind);
760 Expect.equals(0, compiler.crashes.length);
761 } 761 }
762 762
763 testInitializers() { 763 testInitializers() {
764 String script; 764 String script;
765 script = """class A { 765 script = """class A {
766 int foo; int bar; 766 int foo; int bar;
767 A() : this.foo = 1, bar = 2; 767 A() : this.foo = 1, bar = 2;
768 }"""; 768 }""";
769 resolveConstructor(script, "A a = new A();", "A", "", 2); 769 resolveConstructor(script, "A a = new A();", "A", "", 2);
770 770
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 }"""; 1010 }""";
1011 asyncTest(() => compileScript(script2).then((compiler) { 1011 asyncTest(() => compileScript(script2).then((compiler) {
1012 expect(compiler, 1012 expect(compiler,
1013 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS], 1013 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS],
1014 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, 1014 [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
1015 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR, 1015 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
1016 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD, 1016 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
1017 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]); 1017 MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]);
1018 })); 1018 }));
1019 } 1019 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/parser_test.dart ('k') | tests/compiler/dart2js/unparser2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698