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

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

Issue 25471003: Modify tests to use Directory.systemTemp (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 7 years, 2 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 | « tests/standalone/io/link_async_test.dart ('k') | tests/standalone/io/pipe_server_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/link_test.dart
diff --git a/tests/standalone/io/link_test.dart b/tests/standalone/io/link_test.dart
index 78aedc844fa867884b19e47b6752c48b2e494417..ddcb0ee7e828ffb027fde4b7bb83f1353349ad6b 100644
--- a/tests/standalone/io/link_test.dart
+++ b/tests/standalone/io/link_test.dart
@@ -11,12 +11,19 @@ import "dart:isolate";
// Test the dart:io Link class.
testCreateSync() {
- String base = new Directory('').createTempSync().path;
+ String base = Directory.systemTemp.createTempSync('dart_link').path;
+ if (isRelative(base)) {
+ Expect.fail(
+ 'Link tests expect absolute paths to system temporary directories. '
+ 'A relative path in TMPDIR gives relative paths to them.');
+ }
String link = join(base, 'link');
String target = join(base, 'target');
new Directory(target).createSync();
+ print("link: $link");
+ print("target: $target");
new Link(link).createSync(target);
-
+ return;
Expect.equals(FileSystemEntityType.DIRECTORY,
FileSystemEntity.typeSync(link));
Expect.equals(FileSystemEntityType.DIRECTORY,
@@ -147,7 +154,7 @@ testCreateSync() {
}
testCreateLoopingLink() {
- String base = new Directory('').createTempSync().path;
+ String base = Directory.systemTemp.createTempSync('dart_link').path;
new Directory(join(base, 'a', 'b', 'c')).create(recursive: true)
.then((_) =>
new Link(join(base, 'a', 'b', 'c', 'd')).create(join(base, 'a', 'b')))
@@ -182,7 +189,7 @@ testRenameSync() {
Expect.isFalse(link2.existsSync());
}
- Directory baseDir = new Directory('').createTempSync();
+ Directory baseDir = Directory.systemTemp.createTempSync('dart_link');
String base = baseDir.path;
Directory dir = new Directory(join(base, 'a'))..createSync();
File file = new File(join(base, 'b'))..createSync();
@@ -203,7 +210,7 @@ void testLinkErrorSync() {
checkExists(String filePath) => Expect.isTrue(new File(filePath).existsSync());
testRelativeLinksSync() {
- Directory tempDirectory = new Directory('').createTempSync();
+ Directory tempDirectory = Directory.systemTemp.createTempSync('dart_link');
String temp = tempDirectory.path;
String oldWorkingDirectory = Directory.current.path;
// Make directories and files to test links.
« no previous file with comments | « tests/standalone/io/link_async_test.dart ('k') | tests/standalone/io/pipe_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698