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

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

Issue 2067613002: Add Resource.delete() method. (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 1319defb9386dae1cd0d82dfb22be44bcad8ed4d..790eff7dcb11780f363573dc6ae0ee411bbe7c3f 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -50,6 +50,14 @@ class FileTest extends _BaseTest {
expect(source.contents.data, 'contents');
}
+ void test_delete() {
+ new io.File(path).writeAsStringSync('contents');
+ expect(file.exists, isTrue);
+ // delete
+ file.delete();
+ expect(file.exists, isFalse);
+ }
+
void test_equals_differentPaths() {
String path2 = join(tempPath, 'file2.txt');
File file2 = PhysicalResourceProvider.INSTANCE.getResource(path2);
@@ -222,6 +230,16 @@ class FolderTest extends _BaseTest {
expect(folder.contains(path), isFalse);
}
+ void test_delete() {
+ new io.File(join(path, 'myFile')).createSync();
+ var child = folder.getChild('myFile');
+ expect(child, _isFile);
+ expect(child.exists, isTrue);
+ // delete "folder"
+ folder.delete();
+ expect(child.exists, isFalse);
+ }
+
void test_equals_differentPaths() {
String path2 = join(tempPath, 'folder2');
new io.Directory(path2).createSync();
« 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