OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library unittest.test.io; |
| 6 |
| 7 import 'dart:io'; |
| 8 |
| 9 import 'package:path/path.dart' as p; |
| 10 import 'package:stack_trace/stack_trace.dart'; |
| 11 |
| 12 /// The root directory of the `unittest` package. |
| 13 final String packageDir = _computePackageDir(); |
| 14 String _computePackageDir() { |
| 15 var trace = new Trace.current(); |
| 16 return p.dirname(p.dirname(p.fromUri(trace.frames.first.uri))); |
| 17 } |
| 18 |
| 19 /// Returns a matcher that matches a [FileSystemException] with the given |
| 20 /// [message]. |
| 21 Matcher isFileSystemException(String message) => predicate( |
| 22 (error) => error is FileSystemException && error.message == message, |
| 23 'is a FileSystemException with message "$message"'); |
| 24 |
OLD | NEW |