OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 @TestOn("vm") | 5 @TestOn("vm") |
6 | 6 |
7 import 'package:scheduled_test/descriptor.dart' as d; | 7 import 'package:scheduled_test/descriptor.dart' as d; |
8 import 'package:scheduled_test/scheduled_stream.dart'; | 8 import 'package:scheduled_test/scheduled_stream.dart'; |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 | 10 |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 +2 ~2 -2: Some tests failed."""); | 388 +2 ~2 -2: Some tests failed."""); |
389 }); | 389 }); |
390 | 390 |
391 test("displays the skip reason if available", () { | 391 test("displays the skip reason if available", () { |
392 _expectReport(""" | 392 _expectReport(""" |
393 test('skip 1', () {}, skip: 'some reason'); | 393 test('skip 1', () {}, skip: 'some reason'); |
394 test('skip 2', () {}, skip: 'or another');""", | 394 test('skip 2', () {}, skip: 'or another');""", |
395 """ | 395 """ |
396 +0: loading test.dart | 396 +0: loading test.dart |
397 +0: skip 1 | 397 +0: skip 1 |
398 +0 ~1: skip 1 | |
399 Skip: some reason | 398 Skip: some reason |
400 | 399 |
| 400 +0 ~1: skip 1 |
401 +0 ~1: skip 2 | 401 +0 ~1: skip 2 |
402 +0 ~2: skip 2 | |
403 Skip: or another | 402 Skip: or another |
404 | 403 |
| 404 +0 ~2: skip 2 |
405 +0 ~2: All tests skipped."""); | 405 +0 ~2: All tests skipped."""); |
406 }); | 406 }); |
407 }); | 407 }); |
408 } | 408 } |
409 | 409 |
410 void _expectReport(String tests, String expected) { | 410 void _expectReport(String tests, String expected) { |
411 var dart = """ | 411 var dart = """ |
412 import 'dart:async'; | 412 import 'dart:async'; |
413 | 413 |
414 import 'package:test/test.dart'; | 414 import 'package:test/test.dart'; |
(...skipping 30 matching lines...) Expand all Loading... |
445 // Un-indent the expected string. | 445 // Un-indent the expected string. |
446 var indentation = expected.indexOf(new RegExp("[^ ]")); | 446 var indentation = expected.indexOf(new RegExp("[^ ]")); |
447 expected = expected.split("\n").map((line) { | 447 expected = expected.split("\n").map((line) { |
448 if (line.isEmpty) return line; | 448 if (line.isEmpty) return line; |
449 return line.substring(indentation); | 449 return line.substring(indentation); |
450 }).join("\n"); | 450 }).join("\n"); |
451 | 451 |
452 expect(actual, equals(expected)); | 452 expect(actual, equals(expected)); |
453 }); | 453 }); |
454 } | 454 } |
OLD | NEW |