| Index: pkg/analyzer/test/file_system/memory_file_system_test.dart
|
| diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
|
| index b17d39ef757949fc456c66b0bfc8c26d638d61c9..457afe3844d430d061373c3062c7462691f48e65 100644
|
| --- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
|
| +++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
|
| @@ -395,26 +395,35 @@ main() {
|
| });
|
| });
|
|
|
| - test('getChildren', () {
|
| - provider.newFile('/foo/bar/a.txt', 'aaa');
|
| - provider.newFolder('/foo/bar/bFolder');
|
| - provider.newFile('/foo/bar/c.txt', 'ccc');
|
| - // prepare 3 children
|
| - List<Resource> children = folder.getChildren();
|
| - expect(children, hasLength(3));
|
| - children.sort((a, b) => a.shortName.compareTo(b.shortName));
|
| - // check that each child exists
|
| - children.forEach((child) {
|
| - expect(child.exists, true);
|
| - });
|
| - // check names
|
| - expect(children[0].shortName, 'a.txt');
|
| - expect(children[1].shortName, 'bFolder');
|
| - expect(children[2].shortName, 'c.txt');
|
| - // check types
|
| - expect(children[0], _isFile);
|
| - expect(children[1], _isFolder);
|
| - expect(children[2], _isFile);
|
| + group('getChildren', () {
|
| + test('exists', () {
|
| + provider.newFile('/foo/bar/a.txt', 'aaa');
|
| + provider.newFolder('/foo/bar/bFolder');
|
| + provider.newFile('/foo/bar/c.txt', 'ccc');
|
| + // prepare 3 children
|
| + List<Resource> children = folder.getChildren();
|
| + expect(children, hasLength(3));
|
| + children.sort((a, b) => a.shortName.compareTo(b.shortName));
|
| + // check that each child exists
|
| + children.forEach((child) {
|
| + expect(child.exists, true);
|
| + });
|
| + // check names
|
| + expect(children[0].shortName, 'a.txt');
|
| + expect(children[1].shortName, 'bFolder');
|
| + expect(children[2].shortName, 'c.txt');
|
| + // check types
|
| + expect(children[0], _isFile);
|
| + expect(children[1], _isFolder);
|
| + expect(children[2], _isFile);
|
| + });
|
| +
|
| + test('does not exist', () {
|
| + folder = folder.getChildAssumingFolder('no-such-folder');
|
| + expect(() {
|
| + folder.getChildren();
|
| + }, throwsA(_isFileSystemException));
|
| + });
|
| });
|
|
|
| test('parent', () {
|
|
|