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

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

Issue 2058163002: Add Folder.getChildAssumingFile(). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 b40be43061cd5821d757bb072cd68b5ad459e1ae..ef4230184eb04244aa0d55ece806f3544276c07a 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -272,6 +272,26 @@ class FolderTest {
expect(child.exists, isTrue);
}
+ void test_getChildAssumingFile_doesNotExist() {
+ File child = folder.getChildAssumingFile('name');
+ expect(child, isNotNull);
+ expect(child.exists, isFalse);
+ }
+
+ void test_getChildAssumingFile_file() {
+ provider.newFile('/foo/bar/name', 'content');
+ File child = folder.getChildAssumingFile('name');
+ expect(child, isNotNull);
+ expect(child.exists, isTrue);
+ }
+
+ void test_getChildAssumingFile_folder() {
+ provider.newFolder('/foo/bar/name');
+ File child = folder.getChildAssumingFile('name');
+ expect(child, isNotNull);
+ expect(child.exists, isFalse);
+ }
+
void test_getChildAssumingFolder_doesNotExist() {
Folder child = folder.getChildAssumingFolder('foldername');
expect(child, isNotNull);

Powered by Google App Engine
This is Rietveld 408576698