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

Unified Diff: pkg/analyzer/test/file_system/physical_resource_provider_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
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/file_system/physical_resource_provider_test.dart
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 5bf325667245ce1451fe64d67e919e9f65db5f41..1319defb9386dae1cd0d82dfb22be44bcad8ed4d 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -254,6 +254,26 @@ class FolderTest extends _BaseTest {
expect(child.exists, isTrue);
}
+ void test_getChildAssumingFile_doesNotExist() {
+ File child = folder.getChildAssumingFile('no-such-resource');
+ expect(child, isNotNull);
+ expect(child.exists, isFalse);
+ }
+
+ void test_getChildAssumingFile_file() {
+ new io.File(join(path, 'myFile')).createSync();
+ File child = folder.getChildAssumingFile('myFile');
+ expect(child, isNotNull);
+ expect(child.exists, isTrue);
+ }
+
+ void test_getChildAssumingFile_folder() {
+ new io.Directory(join(path, 'myFolder')).createSync();
+ File child = folder.getChildAssumingFile('myFolder');
+ expect(child, isNotNull);
+ expect(child.exists, isFalse);
+ }
+
void test_getChildAssumingFolder_doesNotExist() {
Folder child = folder.getChildAssumingFolder('no-such-resource');
expect(child, isNotNull);
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698