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

Unified Diff: tests/standalone/io/directory_test.dart

Issue 10639004: Add .fromPath constructors to File and Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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: tests/standalone/io/directory_test.dart
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
index 139c8692f0bde607ec8c3810294f2114ec3b6d9e..97608544cf20dace491780ca4ca981a49b6dc638 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -320,6 +320,16 @@ class DirectoryTest {
}
}
+ static void testFromPath() {
+ Directory current = new Directory.fromPath(new Path('.'));
Bill Hesse 2012/06/21 16:02:58 Remove current - it is not used.
Mads Ager (google) 2012/06/22 07:44:36 Please do. Instead of adding comments to your code
Bill Hesse 2012/06/22 10:35:33 Done.
+ var name = new File('.').fullPathSync();
+ Directory current1 = new Directory(name);
+ var path = new Path.fromNative(name);
+ Directory current2 = new Directory.fromPath(path);
+ Expect.equals(current1.path, current2.path);
+ Expect.isTrue(current1.existsSync());
+ }
+
static void testMain() {
testListing();
testListNonExistent();
@@ -333,6 +343,7 @@ class DirectoryTest {
testCreateTemp();
testCreateDeleteTemp();
testCurrent();
+ testFromPath();
}
}

Powered by Google App Engine
This is Rietveld 408576698