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

Unified Diff: tests/language/malformed_test.dart

Issue 57133004: Complete latest spec changes regarding malformed types (see issue 14006). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/language/language_dart2js.status ('k') | tests/standalone/io/skipping_dart2js_compilations_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/malformed_test.dart
===================================================================
--- tests/language/malformed_test.dart (revision 29923)
+++ tests/language/malformed_test.dart (working copy)
@@ -9,10 +9,10 @@
import 'package:expect/expect.dart' as prefix; // Define 'prefix'.
checkIsUnresolved(var v) {
- Expect.isTrue(v is Unresolved);
- Expect.isTrue(v is Unresolved<int>);
- Expect.isTrue(v is prefix.Unresolved);
- Expect.isTrue(v is prefix.Unresolved<int>);
+ Expect.throws(() => v is Unresolved, (e) => e is TypeError);
+ Expect.throws(() => v is Unresolved<int>, (e) => e is TypeError);
+ Expect.throws(() => v is prefix.Unresolved, (e) => e is TypeError);
+ Expect.throws(() => v is prefix.Unresolved<int>, (e) => e is TypeError);
}
checkIsListUnresolved(bool expect, var v) {
@@ -29,10 +29,10 @@
}
checkAsUnresolved(var v) {
- Expect.equals(v, v as Unresolved);
- Expect.equals(v, v as Unresolved<int>);
- Expect.equals(v, v as prefix.Unresolved);
- Expect.equals(v, v as prefix.Unresolved<int>);
+ Expect.throws(() => v as Unresolved, (e) => e is TypeError);
+ Expect.throws(() => v as Unresolved<int>, (e) => e is TypeError);
+ Expect.throws(() => v as prefix.Unresolved, (e) => e is TypeError);
+ Expect.throws(() => v as prefix.Unresolved<int>, (e) => e is TypeError);
}
checkAsListUnresolved(bool expect, var v) {
@@ -125,24 +125,40 @@
Expect.throws(() => new undeclared_prefix.Unresolved<int>(), (e) => true); /// 05: compile-time error
try {
- throw 'foo';
- } on Unresolved catch (e) {
- // Equivalent to 'on dynamic', catches 'foo'.
+ try {
+ throw 'foo';
+ } on Unresolved catch (e) {
+ Expect.fail("This code shouldn't be executed");
+ }
+ Expect.fail("This code shouldn't be executed");
+ } on TypeError catch (e) {
}
try {
- throw 'foo';
- } on Unresolved<int> catch (e) {
- // Equivalent to 'on dynamic', catches 'foo'.
+ try {
+ throw 'foo';
+ } on Unresolved<int> catch (e) {
+ Expect.fail("This code shouldn't be executed");
+ }
+ Expect.fail("This code shouldn't be executed");
+ } on TypeError catch (e) {
}
try {
- throw 'foo';
- } on prefix.Unresolved catch (e) {
- // Equivalent to 'on dynamic', catches 'foo'.
+ try {
+ throw 'foo';
+ } on prefix.Unresolved catch (e) {
+ Expect.fail("This code shouldn't be executed");
+ }
+ Expect.fail("This code shouldn't be executed");
+ } on TypeError catch (e) {
}
try {
- throw 'foo';
- } on prefix.Unresolved<int> catch (e) {
- // Equivalent to 'on dynamic', catches 'foo'.
+ try {
+ throw 'foo';
+ } on prefix.Unresolved<int> catch (e) {
+ Expect.fail("This code shouldn't be executed");
+ }
+ Expect.fail("This code shouldn't be executed");
+ } on TypeError catch (e) {
}
try {
throw 'foo';
« no previous file with comments | « tests/language/language_dart2js.status ('k') | tests/standalone/io/skipping_dart2js_compilations_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698