| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.physical_file_system; | 5 library test.physical_file_system; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io' as io; | 8 import 'dart:io' as io; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 String path; | 127 String path; |
| 128 File file; | 128 File file; |
| 129 | 129 |
| 130 setUp(() { | 130 setUp(() { |
| 131 path = join(tempPath, 'file.txt'); | 131 path = join(tempPath, 'file.txt'); |
| 132 file = PhysicalResourceProvider.INSTANCE.getResource(path); | 132 file = PhysicalResourceProvider.INSTANCE.getResource(path); |
| 133 }); | 133 }); |
| 134 | 134 |
| 135 test('createSource', () { | 135 test('createSource', () { |
| 136 new io.File(path).writeAsStringSync('contents'); | 136 new io.File(path).writeAsStringSync('contents'); |
| 137 var source = file.createSource(UriKind.FILE_URI); | 137 Source source = file.createSource(); |
| 138 expect(source.uriKind, UriKind.FILE_URI); | 138 expect(source.uriKind, UriKind.FILE_URI); |
| 139 expect(source.exists(), isTrue); | 139 expect(source.exists(), isTrue); |
| 140 expect(source.contents.data, 'contents'); | 140 expect(source.contents.data, 'contents'); |
| 141 }); | 141 }); |
| 142 | 142 |
| 143 group('exists', () { | 143 group('exists', () { |
| 144 test('false', () { | 144 test('false', () { |
| 145 expect(file.exists, isFalse); | 145 expect(file.exists, isFalse); |
| 146 }); | 146 }); |
| 147 | 147 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 expect(folder.canonicalizePath('baz'), equals(join(path, 'baz'))); | 286 expect(folder.canonicalizePath('baz'), equals(join(path, 'baz'))); |
| 287 expect(folder.canonicalizePath(path2), equals(path2)); | 287 expect(folder.canonicalizePath(path2), equals(path2)); |
| 288 expect(folder.canonicalizePath(join('..', 'folder2')), equals(path2)); | 288 expect(folder.canonicalizePath(join('..', 'folder2')), equals(path2)); |
| 289 expect(folder.canonicalizePath(join(path2, '..', 'folder3')), equals(p
ath3)); | 289 expect(folder.canonicalizePath(join(path2, '..', 'folder3')), equals(p
ath3)); |
| 290 expect(folder.canonicalizePath(join('.', 'baz')), equals(join(path, 'b
az'))); | 290 expect(folder.canonicalizePath(join('.', 'baz')), equals(join(path, 'b
az'))); |
| 291 expect(folder.canonicalizePath(join(path2, '.', 'baz')), equals(join(p
ath2, 'baz'))); | 291 expect(folder.canonicalizePath(join(path2, '.', 'baz')), equals(join(p
ath2, 'baz'))); |
| 292 }); | 292 }); |
| 293 }); | 293 }); |
| 294 }); | 294 }); |
| 295 } | 295 } |
| OLD | NEW |