Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Unified Diff: pkg/analyzer/test/file_system/memory_file_system_test.dart

Issue 989393002: Wrap dart:io exception in getChildren(), implement for the memory FS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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', () {

Powered by Google App Engine
This is Rietveld 408576698