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; | |
11 | |
12 import 'dart:async'; | 10 import 'dart:async'; |
13 import 'dart:convert'; | 11 import 'dart:convert'; |
14 import 'dart:io'; | 12 import 'dart:io'; |
15 import 'dart:math'; | 13 import 'dart:math'; |
16 | 14 |
17 import 'package:http/testing.dart'; | 15 import 'package:http/testing.dart'; |
18 import 'package:path/path.dart' as p; | 16 import 'package:path/path.dart' as p; |
19 import 'package:pub/src/entrypoint.dart'; | 17 import 'package:pub/src/entrypoint.dart'; |
20 import 'package:pub/src/exceptions.dart'; | 18 import 'package:pub/src/exceptions.dart'; |
21 import 'package:pub/src/exit_codes.dart' as exit_codes; | 19 import 'package:pub/src/exit_codes.dart' as exit_codes; |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 _lastMatcher.matches(item.last, matchState); | 847 _lastMatcher.matches(item.last, matchState); |
850 } | 848 } |
851 | 849 |
852 Description describe(Description description) { | 850 Description describe(Description description) { |
853 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 851 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
854 } | 852 } |
855 } | 853 } |
856 | 854 |
857 /// A [StreamMatcher] that matches multiple lines of output. | 855 /// A [StreamMatcher] that matches multiple lines of output. |
858 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); | 856 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); |
OLD | NEW |