Chromium Code Reviews

Side by Side Diff: test/runner/tag_test.dart

Issue 1662783004: Properly use the sandbox in tag_test.dart. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 import '../io.dart'; 11 import '../io.dart';
12 12
13 void main() { 13 void main() {
14 useSandbox(); 14 useSandbox(() {
15
16 setUp(() {
17 d.file("test.dart", """ 15 d.file("test.dart", """
18 import 'package:test/test.dart'; 16 import 'package:test/test.dart';
19 17
20 void main() { 18 void main() {
21 test("no tags", () {}); 19 test("no tags", () {});
22 test("a", () {}, tags: "a"); 20 test("a", () {}, tags: "a");
23 test("b", () {}, tags: "b"); 21 test("b", () {}, tags: "b");
24 test("bc", () {}, tags: ["b", "c"]); 22 test("bc", () {}, tags: ["b", "c"]);
25 } 23 }
26 """).create(); 24 """).create();
(...skipping 308 matching lines...)
335 } 333 }
336 334
337 // Consume until the end of the warning block, and assert that it has no 335 // Consume until the end of the warning block, and assert that it has no
338 // further tags than the ones we specified. 336 // further tags than the ones we specified.
339 yield consumeWhile(isNot(anyOf([contains(" was used in"), isEmpty]))); 337 yield consumeWhile(isNot(anyOf([contains(" was used in"), isEmpty])));
340 yield isEmpty; 338 yield isEmpty;
341 }()); 339 }());
342 340
343 /// Returns a [StreamMatcher] that matches the lines of [string] in order. 341 /// Returns a [StreamMatcher] that matches the lines of [string] in order.
344 StreamMatcher lines(String string) => inOrder(string.split("\n")); 342 StreamMatcher lines(String string) => inOrder(string.split("\n"));
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine