| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 test("foo", () {}, tags: "a"); | 248 test("foo", () {}, tags: "a"); |
| 249 } | 249 } |
| 250 """).create(); | 250 """).create(); |
| 251 | 251 |
| 252 var test = runTest(["-p", "vm,content-shell", "test.dart"]); | 252 var test = runTest(["-p", "vm,content-shell", "test.dart"]); |
| 253 test.stdout.expect(consumeThrough(lines( | 253 test.stdout.expect(consumeThrough(lines( |
| 254 'Warning: A tag was used that wasn\'t specified in dart_test.yaml.\n' | 254 'Warning: A tag was used that wasn\'t specified in dart_test.yaml.\n' |
| 255 ' a was used in the test "foo"'))); | 255 ' a was used in the test "foo"'))); |
| 256 test.stdout.expect(never(startsWith("Warning:"))); | 256 test.stdout.expect(never(startsWith("Warning:"))); |
| 257 test.shouldExit(0); | 257 test.shouldExit(0); |
| 258 }); | 258 }, tags: "content-shell"); |
| 259 }); | 259 }); |
| 260 | 260 |
| 261 group("invalid tags", () { | 261 group("invalid tags", () { |
| 262 test("are disallowed by test()", () { | 262 test("are disallowed by test()", () { |
| 263 d.file("test.dart", """ | 263 d.file("test.dart", """ |
| 264 import 'package:test/test.dart'; | 264 import 'package:test/test.dart'; |
| 265 | 265 |
| 266 void main() { | 266 void main() { |
| 267 test("foo", () {}, tags: "a b"); | 267 test("foo", () {}, tags: "a b"); |
| 268 } | 268 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 | 329 |
| 330 // Consume until the end of the warning block, and assert that it has no | 330 // Consume until the end of the warning block, and assert that it has no |
| 331 // further tags than the ones we specified. | 331 // further tags than the ones we specified. |
| 332 yield consumeWhile(isNot(anyOf([contains(" was used in"), isEmpty]))); | 332 yield consumeWhile(isNot(anyOf([contains(" was used in"), isEmpty]))); |
| 333 yield isEmpty; | 333 yield isEmpty; |
| 334 }()); | 334 }()); |
| 335 | 335 |
| 336 /// Returns a [StreamMatcher] that matches the lines of [string] in order. | 336 /// Returns a [StreamMatcher] that matches the lines of [string] in order. |
| 337 StreamMatcher lines(String string) => inOrder(string.split("\n")); | 337 StreamMatcher lines(String string) => inOrder(string.split("\n")); |
| OLD | NEW |