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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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) 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";
6
7 int x = "milou"; 5 int x = "milou";
8 bool inCheckedMode = false; 6 bool inCheckedMode = false;
9 7
10 bool readXThrows() { 8 bool readXThrows() {
11 try { 9 try {
12 var y = x; 10 var y = x;
13 return false; 11 return false;
14 } catch (e) { 12 } catch (e) {
15 inCheckedMode = true; 13 inCheckedMode = true;
16 x = 5; // Make sure we do not throw exception a second time. 14 x = 5; // Make sure we do not throw exception a second time.
17 return true; 15 return true;
18 } 16 }
19 } 17 }
20 18
21 main() { 19 main() {
22 int numExceptions = 0; 20 int numExceptions = 0;
23 for (int i = 0; i < 8; i++) { 21 for (int i = 0; i < 8; i++) {
24 if (readXThrows()) { 22 if (readXThrows()) {
25 numExceptions++; 23 numExceptions++;
26 } 24 }
27 } 25 }
28 // In checked mode throw only one exception. 26 // In checked mode throw only one exception.
29 Expect.equals(inCheckedMode ? 1 : 0, numExceptions); 27 Expect.equals(inCheckedMode ? 1 : 0, numExceptions);
30 } 28 }
OLDNEW
« no previous file with comments | « tests/language/static_implicit_closure_test.dart ('k') | tests/language/static_inline_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698