OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// Test infrastructure for testing pub. | 5 /// Test infrastructure for testing pub. |
6 /// | 6 /// |
7 /// Unlike typical unit tests, most pub tests are integration tests that stage | 7 /// Unlike typical unit tests, most pub tests are integration tests that stage |
8 /// some stuff on the file system, run pub, and then validate the results. This | 8 /// some stuff on the file system, run pub, and then validate the results. This |
9 /// library provides an API to build tests like that. | 9 /// library provides an API to build tests like that. |
10 library test_pub; | 10 library test_pub; |
11 | 11 |
12 import 'dart:async'; | 12 import 'dart:async'; |
13 import 'dart:convert'; | 13 import 'dart:convert'; |
14 import 'dart:io'; | 14 import 'dart:io'; |
15 import 'dart:math'; | 15 import 'dart:math'; |
16 | 16 |
17 import 'package:http/testing.dart'; | 17 import 'package:http/testing.dart'; |
18 import 'package:path/path.dart' as path; | 18 import 'package:path/path.dart' as path; |
19 import 'package:scheduled_test/scheduled_process.dart'; | 19 import 'package:scheduled_test/scheduled_process.dart'; |
20 import 'package:scheduled_test/scheduled_server.dart'; | 20 import 'package:scheduled_test/scheduled_server.dart'; |
21 import 'package:scheduled_test/scheduled_stream.dart'; | 21 import 'package:scheduled_test/scheduled_stream.dart'; |
22 import 'package:scheduled_test/scheduled_test.dart'; | 22 import 'package:scheduled_test/scheduled_test.dart' hide fail; |
23 import 'package:shelf/shelf.dart' as shelf; | 23 import 'package:shelf/shelf.dart' as shelf; |
24 import 'package:shelf/shelf_io.dart' as shelf_io; | 24 import 'package:shelf/shelf_io.dart' as shelf_io; |
25 import 'package:unittest/compact_vm_config.dart'; | 25 import 'package:unittest/compact_vm_config.dart'; |
26 import 'package:yaml/yaml.dart'; | 26 import 'package:yaml/yaml.dart'; |
27 | 27 |
28 import '../lib/src/entrypoint.dart'; | 28 import '../lib/src/entrypoint.dart'; |
29 import '../lib/src/exit_codes.dart' as exit_codes; | 29 import '../lib/src/exit_codes.dart' as exit_codes; |
30 // TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides | 30 // TODO(rnystrom): Using "gitlib" as the prefix here is ugly, but "git" collides |
31 // with the git descriptor method. Maybe we should try to clean up the top level | 31 // with the git descriptor method. Maybe we should try to clean up the top level |
32 // scope a bit? | 32 // scope a bit? |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 _lastMatcher.matches(item.last, matchState); | 979 _lastMatcher.matches(item.last, matchState); |
980 } | 980 } |
981 | 981 |
982 Description describe(Description description) { | 982 Description describe(Description description) { |
983 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 983 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
984 } | 984 } |
985 } | 985 } |
986 | 986 |
987 /// A [StreamMatcher] that matches multiple lines of output. | 987 /// A [StreamMatcher] that matches multiple lines of output. |
988 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); | 988 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); |
OLD | NEW |