| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
| 10 import 'package:scheduled_test/descriptor.dart' as d; | 10 import 'package:scheduled_test/descriptor.dart' as d; |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 void main() { | 367 void main() { |
| 368 test("success", () => new Future.delayed(Duration.ZERO)); | 368 test("success", () => new Future.delayed(Duration.ZERO)); |
| 369 } | 369 } |
| 370 """).create(); | 370 """).create(); |
| 371 | 371 |
| 372 var test = runTest(["--timeout=none", "test.dart"]); | 372 var test = runTest(["--timeout=none", "test.dart"]); |
| 373 test.stdout.expect(consumeThrough(contains("All tests passed!"))); | 373 test.stdout.expect(consumeThrough(contains("All tests passed!"))); |
| 374 test.shouldExit(0); | 374 test.shouldExit(0); |
| 375 }); | 375 }); |
| 376 | 376 |
| 377 |
| 378 test("uses the specified regexp names", () { |
| 379 d.file("dart_test.yaml", JSON.encode({ |
| 380 "names": ["z[ia]p", "a"] |
| 381 })).create(); |
| 382 |
| 383 d.file("test.dart", """ |
| 384 import 'package:test/test.dart'; |
| 385 |
| 386 void main() { |
| 387 test("zip", () {}); |
| 388 test("zap", () {}); |
| 389 test("zop", () {}); |
| 390 } |
| 391 """).create(); |
| 392 |
| 393 var test = runTest(["test.dart"]); |
| 394 test.stdout.expect(containsInOrder([ |
| 395 "+0: zap", |
| 396 "+1: All tests passed!" |
| 397 ])); |
| 398 test.shouldExit(0); |
| 399 }); |
| 400 |
| 401 test("uses the specified plain names", () { |
| 402 d.file("dart_test.yaml", JSON.encode({ |
| 403 "names": ["z", "a"] |
| 404 })).create(); |
| 405 |
| 406 d.file("test.dart", """ |
| 407 import 'package:test/test.dart'; |
| 408 |
| 409 void main() { |
| 410 test("zip", () {}); |
| 411 test("zap", () {}); |
| 412 test("zop", () {}); |
| 413 } |
| 414 """).create(); |
| 415 |
| 416 var test = runTest(["test.dart"]); |
| 417 test.stdout.expect(containsInOrder([ |
| 418 "+0: zap", |
| 419 "+1: All tests passed!" |
| 420 ])); |
| 421 test.shouldExit(0); |
| 422 }); |
| 423 |
| 377 test("uses the specified paths", () { | 424 test("uses the specified paths", () { |
| 378 d.file("dart_test.yaml", JSON.encode({ | 425 d.file("dart_test.yaml", JSON.encode({ |
| 379 "paths": ["zip", "zap"] | 426 "paths": ["zip", "zap"] |
| 380 })).create(); | 427 })).create(); |
| 381 | 428 |
| 382 d.dir("zip", [ | 429 d.dir("zip", [ |
| 383 d.file("zip_test.dart", """ | 430 d.file("zip_test.dart", """ |
| 384 import 'package:test/test.dart'; | 431 import 'package:test/test.dart'; |
| 385 | 432 |
| 386 void main() { | 433 void main() { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 test("failure", () => throw "oh no"); | 490 test("failure", () => throw "oh no"); |
| 444 } | 491 } |
| 445 """) | 492 """) |
| 446 ]).create(); | 493 ]).create(); |
| 447 | 494 |
| 448 var test = runTest([]); | 495 var test = runTest([]); |
| 449 test.stdout.expect(consumeThrough(contains('All tests passed!'))); | 496 test.stdout.expect(consumeThrough(contains('All tests passed!'))); |
| 450 test.shouldExit(0); | 497 test.shouldExit(0); |
| 451 }); | 498 }); |
| 452 } | 499 } |
| OLD | NEW |