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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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
5 var x = ""; 7 var x = "";
6 8
7 test(String str, [onError(String)]) { 9 test(String str, [onError(String)]) {
8 return (() { 10 return (() {
9 try { 11 try {
10 throw ""; 12 throw "";
11 } catch(e) { 13 } catch(e) {
12 if (?onError) { 14 if (?onError) {
13 onError(str); 15 onError(str);
14 } else { 16 } else {
15 x = "${str} error"; 17 x = "${str} error";
16 } 18 }
17 } 19 }
18 }); 20 });
19 } 21 }
20 22
21 ignoreError(String str) { 23 ignoreError(String str) {
22 x = "${str} error ignored"; 24 x = "${str} error ignored";
23 } 25 }
24 26
25 main() { 27 main() {
26 Expect.equals("", x); 28 Expect.equals("", x);
27 test("test")(); 29 test("test")();
28 Expect.equals("test error", x); 30 Expect.equals("test error", x);
29 test("test", ignoreError)(); 31 test("test", ignoreError)();
30 Expect.equals("test error ignored", x); 32 Expect.equals("test error ignored", x);
31 } 33 }
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