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

Side by Side Diff: tests/language/implied_interface_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
« no previous file with comments | « tests/language/getter_no_setter_test.dart ('k') | tests/language/instanceof3_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 class BaseClass { 5 class BaseClass {
6 var foo; 6 var foo;
7 BaseClass() { foo = 0; } 7 BaseClass() { foo = 0; }
8 toString() => "BaseClass"; 8 toString() => "BaseClass";
9 } 9 }
10 10
(...skipping 16 matching lines...) Expand all
27 class ImplementsExtendsClass implements ExtendsClass { 27 class ImplementsExtendsClass implements ExtendsClass {
28 ImplementsExtendsClass() {} 28 ImplementsExtendsClass() {}
29 } 29 }
30 30
31 main() { 31 main() {
32 ImplementsClass c1 = new ImplementsClass(); 32 ImplementsClass c1 = new ImplementsClass();
33 ImplementsExtendsClass c2 = new ImplementsExtendsClass(); 33 ImplementsExtendsClass c2 = new ImplementsExtendsClass();
34 try { 34 try {
35 c1.foo; 35 c1.foo;
36 Expect.fail('expected a NoSuchMethodException'); 36 Expect.fail('expected a NoSuchMethodException');
37 } catch (NoSuchMethodException ex) { 37 } on NoSuchMethodException catch (ex) {
38 // Expected error. 38 // Expected error.
39 } 39 }
40 try { 40 try {
41 c2.foo; 41 c2.foo;
42 Expect.fail('expected a NoSuchMethodException'); 42 Expect.fail('expected a NoSuchMethodException');
43 } catch (NoSuchMethodException ex) { 43 } on NoSuchMethodException catch (ex) {
44 // Expected error. 44 // Expected error.
45 } 45 }
46 Expect.equals(true, c1 is BaseClass); 46 Expect.equals(true, c1 is BaseClass);
47 Expect.equals(true, c1 is !ExtendsClass); 47 Expect.equals(true, c1 is !ExtendsClass);
48 Expect.equals(true, c2 is BaseClass); 48 Expect.equals(true, c2 is BaseClass);
49 Expect.equals(true, c2 is ExtendsClass); 49 Expect.equals(true, c2 is ExtendsClass);
50 Expect.equals(true, c2 is !ImplementsClass); 50 Expect.equals(true, c2 is !ImplementsClass);
51 Expect.equals("BaseClass", "${new BaseClass()}"); 51 Expect.equals("BaseClass", "${new BaseClass()}");
52 52
53 // Verify we don't inherit toString from BaseClass 53 // Verify we don't inherit toString from BaseClass
54 Expect.notEquals("BaseClass", "${c1}"); 54 Expect.notEquals("BaseClass", "${c1}");
55 Expect.notEquals("BaseClass", "${c2}"); 55 Expect.notEquals("BaseClass", "${c2}");
56 } 56 }
OLDNEW
« no previous file with comments | « tests/language/getter_no_setter_test.dart ('k') | tests/language/instanceof3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698