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

Side by Side Diff: tests/language/argument_definition5_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 var x = ""; 5 var x = "";
8 6
9 test(String str, [onError(String)]) { 7 test(String str, [onError(String)]) {
10 return (() { 8 return (() {
11 try { 9 try {
12 throw ""; 10 throw "";
13 } catch(e) { 11 } catch(e) {
14 if (?onError) { 12 if (?onError) {
15 onError(str); 13 onError(str);
16 } else { 14 } else {
17 x = "${str} error"; 15 x = "${str} error";
18 } 16 }
19 } 17 }
20 }); 18 });
21 } 19 }
22 20
23 ignoreError(String str) { 21 ignoreError(String str) {
24 x = "${str} error ignored"; 22 x = "${str} error ignored";
25 } 23 }
26 24
27 main() { 25 main() {
28 Expect.equals("", x); 26 Expect.equals("", x);
29 test("test")(); 27 test("test")();
30 Expect.equals("test error", x); 28 Expect.equals("test error", x);
31 test("test", ignoreError)(); 29 test("test", ignoreError)();
32 Expect.equals("test error ignored", x); 30 Expect.equals("test error ignored", x);
33 } 31 }
OLDNEW
« no previous file with comments | « tests/language/argument_definition4_test.dart ('k') | tests/language/argument_definition_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698