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

Side by Side Diff: tests/light_unittest.dart

Issue 23701010: Switch to async_helper package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase and adapt 3 new tests. Created 7 years, 3 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/lib/mirrors/invoke_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) 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 /// A light-weight replacement for package:unittest. This library runs tests 5 /// A light-weight replacement for package:unittest. This library runs tests
6 /// synchronously, and avoids using reflection. 6 /// synchronously, and avoids using reflection.
7 library light_unittest; 7 library light_unittest;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 10
11 import 'async_helper.dart'; 11 import 'package:async_helper/async_helper.dart';
12 import '../pkg/expect/lib/expect.dart'; 12 import '../pkg/expect/lib/expect.dart';
13 13
14 test(name, f) { 14 test(name, f) {
15 print('Testing $name'); 15 print('Testing $name');
16 try { 16 try {
17 f(); 17 f();
18 print('PASS: $name'); 18 print('PASS: $name');
19 } catch (e, trace) { 19 } catch (e, trace) {
20 print('FAIL: $name.'); 20 print('FAIL: $name.');
21 print(e); 21 print(e);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 expectAsync1(then) { 59 expectAsync1(then) {
60 asyncStart(); 60 asyncStart();
61 return (x) { 61 return (x) {
62 // 'then(x)' may call 'asyncStart()', so we first need to execute it, before 62 // 'then(x)' may call 'asyncStart()', so we first need to execute it, before
63 // we can call 'asyncEnd()'. 63 // we can call 'asyncEnd()'.
64 var result = then(x); 64 var result = then(x);
65 asyncEnd(); 65 asyncEnd();
66 return result; 66 return result;
67 }; 67 };
68 } 68 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/invoke_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698