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

Side by Side Diff: tests/standalone/io/file_constructor_test.dart

Issue 22548003: Fix uses of throw/rethrow in tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/type_error_test.dart ('k') | no next file » | 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 void main() { 8 void main() {
9 bool developerMode = false; 9 bool developerMode = false;
10 assert(developerMode = true); 10 assert(developerMode = true);
11 new File('blåbærgrød'); 11 new File('blåbærgrød');
12 new File('foo.txt'); 12 new File('foo.txt');
13 try { 13 try {
14 new File(null); 14 new File(null);
15 Expect.fail('ArgumentError expected.'); 15 Expect.fail('ArgumentError expected.');
16 } on ArgumentError catch(e) { 16 } on ArgumentError catch(e) {
17 // Expected. 17 // Expected.
18 } 18 }
19 try { 19 try {
20 new File(1); 20 new File(1);
21 Expect.fail('Error expected.'); 21 Expect.fail('Error expected.');
22 } on ArgumentError catch(e) { 22 } on ArgumentError catch(e) {
23 if (developerMode) throw; 23 if (developerMode) rethrow;
24 } on TypeError catch(e) { 24 } on TypeError catch(e) {
25 if (!developerMode) throw; 25 if (!developerMode) rethrow;
26 } 26 }
27 } 27 }
OLDNEW
« no previous file with comments | « tests/language/type_error_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698