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

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

Issue 16154017: Rename RuntimeError to CyclicIntializationError, as per spec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 library test_extension_test; 5 library test_extension_test;
6 6
7 import "test_extension.dart"; 7 import "test_extension.dart";
8 8
9 class Expect { 9 class Expect {
10 static void equals(expected, actual, [msg]) { 10 static void equals(expected, actual, [msg]) {
11 if (expected != actual) { 11 if (expected != actual) {
12 if (msg == null) msg = "Expected: $expected. Actual: $actual"; 12 if (msg == null) msg = "Expected: $expected. Actual: $actual";
13 throw new RuntimeError(msg); 13 throw new StateError(msg);
14 } 14 }
15 } 15 }
16 16
17 static void isNull(x, [msg]) { 17 static void isNull(x, [msg]) {
18 if (x != null) { 18 if (x != null) {
19 if (msg != null) msg = "$x not null"; 19 if (msg != null) msg = "$x not null";
20 throw new RuntimeError(msg); 20 throw new StateError(msg);
21 } 21 }
22 } 22 }
23 } 23 }
24 24
25 main() { 25 main() {
26 Expect.equals('cat 13', new Cat(13).toString(), 'new Cat(13).toString()'); 26 Expect.equals('cat 13', new Cat(13).toString(), 'new Cat(13).toString()');
27 27
28 Expect.equals(3, Cat.ifNull(null, 3), 'Cat.ifNull(null, 3)'); 28 Expect.equals(3, Cat.ifNull(null, 3), 'Cat.ifNull(null, 3)');
29 Expect.equals(4, Cat.ifNull(4, null), 'Cat.ifNull(4, null)'); 29 Expect.equals(4, Cat.ifNull(4, null), 'Cat.ifNull(4, null)');
30 Expect.equals(5, Cat.ifNull(5, 9), 'Cat.ifNull(5, 9)'); 30 Expect.equals(5, Cat.ifNull(5, 9), 'Cat.ifNull(5, 9)');
31 Expect.isNull(Cat.ifNull(null, null), 'Cat.ifNull(null, null)'); 31 Expect.isNull(Cat.ifNull(null, null), 'Cat.ifNull(null, null)');
32 32
33 try { 33 try {
34 Cat.throwMeTheBall("ball"); 34 Cat.throwMeTheBall("ball");
35 } on String catch (e) { 35 } on String catch (e) {
36 Expect.equals("ball", e); 36 Expect.equals("ball", e);
37 } 37 }
38 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698