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

Side by Side Diff: tests/standalone/io/resolve_symbolic_links_test.dart

Issue 52723007: Revert "Change dart:io Platform.script to return a Uri." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Dart test program for testing FileSystemEntity.resolveSymbolicLinks 5 // Dart test program for testing FileSystemEntity.resolveSymbolicLinks
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import "package:path/path.dart"; 8 import "package:path/path.dart";
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 import 'dart:async'; 10 import 'dart:async';
11 import 'dart:io'; 11 import 'dart:io';
12 12
13 main() { 13 main() {
14 String testsDir = Platform.script.resolve('../..').toFilePath(); 14 String testsDir = dirname(dirname(dirname(Platform.script)));
15 // All of these tests test that resolveSymbolicLinks gives a path 15 // All of these tests test that resolveSymbolicLinks gives a path
16 // that points to the same place as the original, and that it removes 16 // that points to the same place as the original, and that it removes
17 // all links, .., and . segments, and that it produces an absolute path. 17 // all links, .., and . segments, and that it produces an absolute path.
18 asyncTest(() => testFile(join( 18 asyncTest(() => testFile(join(
19 testsDir, 'standalone', 'io', 'resolve_symbolic_links_test.dart'))); 19 testsDir, 'standalone', 'io', 'resolve_symbolic_links_test.dart')));
20 asyncTest(() => testFile(join(testsDir, 'standalone', 'io', '..', 'io', 20 asyncTest(() => testFile(join(testsDir, 'standalone', 'io', '..', 'io',
21 'resolve_symbolic_links_test.dart'))); 21 'resolve_symbolic_links_test.dart')));
22 22
23 asyncTest(() => testDir(join(testsDir, 'standalone', 'io'))); 23 asyncTest(() => testDir(join(testsDir, 'standalone', 'io')));
24 asyncTest(() => testDir(join(testsDir, 'lib', '..', 'standalone', 'io'))); 24 asyncTest(() => testDir(join(testsDir, 'lib', '..', 'standalone', 'io')));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 Expect.isTrue(isAbsolute(resolved)); 139 Expect.isTrue(isAbsolute(resolved));
140 // Test that resolveSymbolicLinks removes all links, .., and . segments. 140 // Test that resolveSymbolicLinks removes all links, .., and . segments.
141 Expect.isFalse(resolved.contains('..')); 141 Expect.isFalse(resolved.contains('..'));
142 Expect.isFalse(resolved.contains('./')); 142 Expect.isFalse(resolved.contains('./'));
143 Expect.isFalse(resolved.contains('link1')); 143 Expect.isFalse(resolved.contains('link1'));
144 return new Link(name).target() 144 return new Link(name).target()
145 .then((targetName) => FileSystemEntity.identical(targetName, resolved)) 145 .then((targetName) => FileSystemEntity.identical(targetName, resolved))
146 .then((identical) => Expect.isTrue(identical)); 146 .then((identical) => Expect.isTrue(identical));
147 }); 147 });
148 } 148 }
OLDNEW
« no previous file with comments | « tests/standalone/io/regress_7191_test.dart ('k') | tests/standalone/io/secure_bad_certificate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698