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

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

Issue 13852043: unittest: testCases back to being UnmodifiableListView (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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) 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 excesscallback(); 285 excesscallback();
286 excesscallback(); 286 excesscallback();
287 excesscallback(); 287 excesscallback();
288 callback(); 288 callback();
289 }); 289 });
290 }); 290 });
291 }); 291 });
292 }); 292 });
293 test('foo6', () { 293 test('foo6', () {
294 }); 294 });
295 } else if (testName == 'testCases immutable') {
296 test(testName, () {
297 expect(() => testCases.clear(), throwsUnsupportedError);
298 expect(() => testCases.removeLast(), throwsUnsupportedError);
299 });
295 } else if (testName == 'runTests without tests') { 300 } else if (testName == 'runTests without tests') {
296 runTests(); 301 runTests();
297 } 302 }
298 }); 303 });
299 } 304 }
300 305
301 main() { 306 main() {
302 var tests = { 307 var tests = {
303 'single correct test': buildStatusString(1, 0, 0, 'single correct test'), 308 'single correct test': buildStatusString(1, 0, 0, 'single correct test'),
304 'single failing test': buildStatusString(0, 1, 0, 'single failing test', 309 'single failing test': buildStatusString(0, 1, 0, 'single failing test',
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 'error2:Callback called more times than expected (1).:' 346 'error2:Callback called more times than expected (1).:'
342 'fail2:failure:' 347 'fail2:failure:'
343 'foo5'), 348 'foo5'),
344 'test returning future using Timer': buildStatusString(2, 4, 0, 349 'test returning future using Timer': buildStatusString(2, 4, 0,
345 'successful::' 350 'successful::'
346 'fail1:Expected: <false> but: was <true>.:' 351 'fail1:Expected: <false> but: was <true>.:'
347 'error1:Callback called more times than expected (1).:' 352 'error1:Callback called more times than expected (1).:'
348 'fail2:failure:' 353 'fail2:failure:'
349 'error2:Callback called more times than expected (1).:' 354 'error2:Callback called more times than expected (1).:'
350 'foo6'), 355 'foo6'),
356 'testCases immutable':
357 buildStatusString(1, 0, 0, 'testCases immutable'),
351 'runTests without tests': buildStatusString(0, 0, 0, null) 358 'runTests without tests': buildStatusString(0, 0, 0, null)
352 }; 359 };
353 360
354 tests.forEach((String name, String expected) { 361 tests.forEach((String name, String expected) {
355 test(name, () => spawnFunction(runTest) 362 test(name, () => spawnFunction(runTest)
356 .call(name) 363 .call(name)
357 .then((String msg) => expect(msg.trim(), equals(expected)))); 364 .then((String msg) => expect(msg.trim(), equals(expected))));
358 }); 365 });
359 } 366 }
360 367
OLDNEW
« pkg/unittest/lib/unittest.dart ('K') | « pkg/unittest/lib/unittest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698