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

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

Issue 60293003: Version 0.8.10.5 (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
« no previous file with comments | « dart/tests/language/malformed2_test.dart ('k') | dart/tests/language/type_parameter_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/language/on_catch_malformed_type_test.dart
===================================================================
--- dart/tests/language/on_catch_malformed_type_test.dart (revision 29908)
+++ dart/tests/language/on_catch_malformed_type_test.dart (working copy)
@@ -3,9 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
// Check that malformed types in on-catch are handled correctly, that is,
-// are treated as dynamic and thus catches all in bith production and checked
-// mode.
+// throws a type error in both production and checked mode.
+import 'package:expect/expect.dart';
+
catchUnresolvedBefore() {
try {
throw "foo";
@@ -18,15 +19,17 @@
}
catchUnresolvedAfter() {
- try {
- throw "foo";
- Expect.fail("This code shouldn't be executed");
- } on Unavailable catch(ex) {
- // This is tested before the catch block below.
- // In both production and checked mode the test is always true.
- } on String catch(oks) {
- Expect.fail("This code shouldn't be executed");
- }
+ Expect.throws(() {
+ try {
+ throw "foo";
+ Expect.fail("This code shouldn't be executed");
+ } on Unavailable catch(ex) {
+ // This is tested before the catch block below.
+ // In both production and checked mode the test causes a type error.
+ } on String catch(oks) {
+ Expect.fail("This code shouldn't be executed");
+ }
+ }, (e) => e is TypeError);
}
main() {
« no previous file with comments | « dart/tests/language/malformed2_test.dart ('k') | dart/tests/language/type_parameter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698