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

Side by Side Diff: pkg/unittest/test/unittest_test.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 // TODO(gram): 5 // TODO(gram):
6 // Unfortunately I can't seem to test anything that involves timeouts, e.g. 6 // Unfortunately I can't seem to test anything that involves timeouts, e.g.
7 // insufficient callbacks, because the timeout is controlled externally 7 // insufficient callbacks, because the timeout is controlled externally
8 // (test.dart?), and we would need to use a shorter timeout for the inner tests 8 // (test.dart?), and we would need to use a shorter timeout for the inner tests
9 // so the outer timeout doesn't fire. So I removed all such tests. 9 // so the outer timeout doesn't fire. So I removed all such tests.
10 // I'd like to revisit this at some point. 10 // I'd like to revisit this at some point.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 }); 126 });
127 } else if (testName == 'async exception test') { 127 } else if (testName == 'async exception test') {
128 test(testName, () { 128 test(testName, () {
129 expectAsync0(() {}); 129 expectAsync0(() {});
130 _defer(() => guardAsync(() { throw "error!"; })); 130 _defer(() => guardAsync(() { throw "error!"; }));
131 }); 131 });
132 } else if (testName == 'late exception test') { 132 } else if (testName == 'late exception test') {
133 test('testOne', () { 133 test('testOne', () {
134 var f = expectAsync0(() {}); 134 var f = expectAsync0(() {});
135 _defer(protectAsync0(() { 135 _defer(protectAsync0(() {
136 _defer(protectAsync0(() => expect(false))); 136 _defer(protectAsync0(() => expect(false, isTrue)));
137 expect(false); 137 expect(false, isTrue);
138 })); 138 }));
139 }); 139 });
140 test('testTwo', () { 140 test('testTwo', () {
141 _defer(expectAsync0(() {})); 141 _defer(expectAsync0(() {}));
142 }); 142 });
143 } else if (testName == 'middle exception test') { 143 } else if (testName == 'middle exception test') {
144 test('testOne', () { expect(true, isTrue); }); 144 test('testOne', () { expect(true, isTrue); });
145 test('testTwo', () { expect(true, isFalse); }); 145 test('testTwo', () { expect(true, isFalse); });
146 test('testThree', () { 146 test('testThree', () {
147 var done = expectAsync0((){}); 147 var done = expectAsync0((){});
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'), 203 buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'),
204 buildStatusString(1, 0, 1, 'testOne', message: 'Callback called after alread y being marked as done (1).:testTwo:'), 204 buildStatusString(1, 0, 1, 'testOne', message: 'Callback called after alread y being marked as done (1).:testTwo:'),
205 buildStatusString(2, 1, 0, 'testOne::testTwo:Expected: false but: was <true> .:testThree') 205 buildStatusString(2, 1, 0, 'testOne::testTwo:Expected: false but: was <true> .:testThree')
206 ]; 206 ];
207 207
208 actual = []; 208 actual = [];
209 209
210 nextTest(0); 210 nextTest(0);
211 } 211 }
212 212
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698