| 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 library analyzer.test.resource_utils; | 5 library analyzer.test.resource_utils; |
| 6 | 6 |
| 7 import 'dart:core' hide Resource; | 7 import 'dart:core' hide Resource; |
| 8 | 8 |
| 9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
| 10 import 'package:analyzer/file_system/memory_file_system.dart'; | 10 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 11 import 'package:analyzer/src/util/absolute_path.dart'; | 11 import 'package:analyzer/src/util/absolute_path.dart'; |
| 12 import 'package:path/path.dart' as path; | 12 import 'package:path/path.dart' as path; |
| 13 import 'package:unittest/unittest.dart'; | 13 import 'package:unittest/unittest.dart'; |
| 14 | 14 |
| 15 | |
| 16 bool get isWindows => path.Style.platform == path.Style.windows; | 15 bool get isWindows => path.Style.platform == path.Style.windows; |
| 17 | 16 |
| 18 /** | 17 /** |
| 19 * Assert that the given path is posix and absolute. | 18 * Assert that the given path is posix and absolute. |
| 20 */ | 19 */ |
| 21 void expectAbsolutePosixPath(String posixPath) { | 20 void expectAbsolutePosixPath(String posixPath) { |
| 22 expect(posixPath, startsWith('/'), | 21 expect(posixPath, startsWith('/'), |
| 23 reason: 'Expected absolute posix path, but found $posixPath'); | 22 reason: 'Expected absolute posix path, but found $posixPath'); |
| 24 } | 23 } |
| 25 | 24 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 fail('Expected windows path, but found: $path'); | 120 fail('Expected windows path, but found: $path'); |
| 122 } | 121 } |
| 123 } else { | 122 } else { |
| 124 if (path.contains('\\')) { | 123 if (path.contains('\\')) { |
| 125 fail('Expected posix path, but found: $path'); | 124 fail('Expected posix path, but found: $path'); |
| 126 } | 125 } |
| 127 } | 126 } |
| 128 return path; | 127 return path; |
| 129 } | 128 } |
| 130 } | 129 } |
| OLD | NEW |