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

Unified Diff: dart/tests/language/malformed_test.dart

Issue 60733003: Version 0.8.10.6 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
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
Index: dart/tests/language/malformed_test.dart
===================================================================
--- dart/tests/language/malformed_test.dart (revision 29958)
+++ dart/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';

Powered by Google App Engine
This is Rietveld 408576698