| 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 analyzer.test.file_system.memory_file_system_test; | 5 library analyzer.test.file_system.memory_file_system_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:core'; | 8 import 'dart:core'; |
| 9 | 9 |
| 10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
| 11 import 'package:analyzer/file_system/memory_file_system.dart'; | 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
| 12 import 'package:analyzer/src/generated/engine.dart' show TimestampedData; | 12 import 'package:analyzer/src/generated/engine.dart' show TimestampedData; |
| 13 import 'package:analyzer/src/generated/source.dart'; | 13 import 'package:analyzer/src/generated/source.dart'; |
| 14 import 'package:analyzer/src/generated/utilities_dart.dart'; | 14 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 15 import 'package:path/path.dart'; | 15 import 'package:path/path.dart'; |
| 16 import 'package:test/test.dart'; |
| 16 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 17 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 17 import 'package:unittest/unittest.dart'; | |
| 18 import 'package:watcher/watcher.dart'; | 18 import 'package:watcher/watcher.dart'; |
| 19 | 19 |
| 20 import '../utils.dart'; | |
| 21 | |
| 22 main() { | 20 main() { |
| 23 initializeTestEnvironment(); | 21 defineReflectiveSuite(() { |
| 24 defineReflectiveTests(FileSystemExceptionTest); | 22 defineReflectiveTests(FileSystemExceptionTest); |
| 25 defineReflectiveTests(FileTest); | 23 defineReflectiveTests(FileTest); |
| 26 defineReflectiveTests(FolderTest); | 24 defineReflectiveTests(FolderTest); |
| 27 defineReflectiveTests(MemoryFileSourceExistingTest); | 25 defineReflectiveTests(MemoryFileSourceExistingTest); |
| 28 defineReflectiveTests(MemoryFileSourceNotExistingTest); | 26 defineReflectiveTests(MemoryFileSourceNotExistingTest); |
| 29 defineReflectiveTests(MemoryResourceProviderTest); | 27 defineReflectiveTests(MemoryResourceProviderTest); |
| 28 }); |
| 30 } | 29 } |
| 31 | 30 |
| 32 var _isFile = new isInstanceOf<File>(); | 31 var _isFile = new isInstanceOf<File>(); |
| 33 var _isFileSystemException = new isInstanceOf<FileSystemException>(); | 32 var _isFileSystemException = new isInstanceOf<FileSystemException>(); |
| 34 var _isFolder = new isInstanceOf<Folder>(); | 33 var _isFolder = new isInstanceOf<Folder>(); |
| 35 | 34 |
| 36 @reflectiveTest | 35 @reflectiveTest |
| 37 class FileSystemExceptionTest { | 36 class FileSystemExceptionTest { |
| 38 void test_constructor() { | 37 void test_constructor() { |
| 39 var exception = new FileSystemException('/my/path', 'my message'); | 38 var exception = new FileSystemException('/my/path', 'my message'); |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 return new Future.delayed(Duration.ZERO, computation); | 769 return new Future.delayed(Duration.ZERO, computation); |
| 771 } | 770 } |
| 772 | 771 |
| 773 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) { | 772 _watchingFolder(String path, test(List<WatchEvent> changesReceived)) { |
| 774 Folder folder = provider.getResource(path); | 773 Folder folder = provider.getResource(path); |
| 775 var changesReceived = <WatchEvent>[]; | 774 var changesReceived = <WatchEvent>[]; |
| 776 folder.changes.listen(changesReceived.add); | 775 folder.changes.listen(changesReceived.add); |
| 777 return test(changesReceived); | 776 return test(changesReceived); |
| 778 } | 777 } |
| 779 } | 778 } |
| OLD | NEW |