| OLD | NEW |
| 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 Loading... |
| 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 }); | |
| 300 } else if (testName == 'runTests without tests') { | 295 } else if (testName == 'runTests without tests') { |
| 301 runTests(); | 296 runTests(); |
| 302 } | 297 } |
| 303 }); | 298 }); |
| 304 } | 299 } |
| 305 | 300 |
| 306 main() { | 301 main() { |
| 307 var tests = { | 302 var tests = { |
| 308 'single correct test': buildStatusString(1, 0, 0, 'single correct test'), | 303 'single correct test': buildStatusString(1, 0, 0, 'single correct test'), |
| 309 'single failing test': buildStatusString(0, 1, 0, 'single failing test', | 304 'single failing test': buildStatusString(0, 1, 0, 'single failing test', |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 'error2:Callback called more times than expected (1).:' | 341 'error2:Callback called more times than expected (1).:' |
| 347 'fail2:failure:' | 342 'fail2:failure:' |
| 348 'foo5'), | 343 'foo5'), |
| 349 'test returning future using Timer': buildStatusString(2, 4, 0, | 344 'test returning future using Timer': buildStatusString(2, 4, 0, |
| 350 'successful::' | 345 'successful::' |
| 351 'fail1:Expected: <false> but: was <true>.:' | 346 'fail1:Expected: <false> but: was <true>.:' |
| 352 'error1:Callback called more times than expected (1).:' | 347 'error1:Callback called more times than expected (1).:' |
| 353 'fail2:failure:' | 348 'fail2:failure:' |
| 354 'error2:Callback called more times than expected (1).:' | 349 'error2:Callback called more times than expected (1).:' |
| 355 'foo6'), | 350 'foo6'), |
| 356 'testCases immutable': | |
| 357 buildStatusString(1, 0, 0, 'testCases immutable'), | |
| 358 'runTests without tests': buildStatusString(0, 0, 0, null) | 351 'runTests without tests': buildStatusString(0, 0, 0, null) |
| 359 }; | 352 }; |
| 360 | 353 |
| 361 tests.forEach((String name, String expected) { | 354 tests.forEach((String name, String expected) { |
| 362 test(name, () => spawnFunction(runTest) | 355 test(name, () => spawnFunction(runTest) |
| 363 .call(name) | 356 .call(name) |
| 364 .then((String msg) => expect(msg.trim(), equals(expected)))); | 357 .then((String msg) => expect(msg.trim(), equals(expected)))); |
| 365 }); | 358 }); |
| 366 } | 359 } |
| 367 | 360 |
| OLD | NEW |