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

Side by Side Diff: tests/language/type_checks_in_factory_method_test.dart

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // VMOptions=--enable_type_checks --enable_asserts 4 // VMOptions=--enable_type_checks --enable_asserts
5 // Tests the type checking when passing code into closure from inside a factory method 5 // Tests the type checking when passing code into closure from inside a factory method
6 6
7 interface Foo<T> default Bar<T> { 7 interface Foo<T> default Bar<T> {
8 Foo.from(); 8 Foo.from();
9 } 9 }
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 main() { 27 main() {
28 Foo<String> value1; 28 Foo<String> value1;
29 value1 = new Foo<String>.from(); 29 value1 = new Foo<String>.from();
30 30
31 bool gotError = false; 31 bool gotError = false;
32 32
33 try { 33 try {
34 Foo<int> value2 = new Foo<int>.from(); 34 Foo<int> value2 = new Foo<int>.from();
35 } catch (TypeError e) { 35 } on TypeError catch (e) {
36 gotError = true; 36 gotError = true;
37 } 37 }
38 Expect.equals(true, gotError); 38 Expect.equals(true, gotError);
39 } 39 }
OLDNEW
« no previous file with comments | « tests/language/type_cast_vm_test.dart ('k') | tests/language/type_variable_identifier_expression_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698