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

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

Issue 1083393004: Add uri getter on file system entity. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/link.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 import "package:expect/expect.dart";
6 import "dart:io";
7
8 testFile(String input) {
9 if (Platform.isWindows) {
10 input = input.replaceAll('/', '\\');
11 }
12 var file = new File(input);
13 var uri = file.uri;
14 var file2 = new File.fromUri(uri);
15 Expect.equals(file.path, file2.path, input);
16 }
17
18 testDirectory(String input, [String output]) {
19 if (output == null) output = input;
20 if (Platform.isWindows) {
21 input = input.replaceAll('/', '\\');
22 output = output.replaceAll('/', '\\');
23 }
24 var dir = new Directory(input);
25 var uri = dir.uri;
26 var dir2 = new Directory.fromUri(uri);
27 Expect.equals(output, dir2.path, input);
28 }
29
30 void main() {
31 testFile("");
32 testFile("/");
33 testFile("foo/bar");
34 testFile("/foo/bar");
35 testFile("/foo/bar/");
36
37 testDirectory("", "/");
38 testDirectory("/");
39 testDirectory("foo/bar", "foo/bar/");
40 testDirectory("/foo/bar", "/foo/bar/");
41 testDirectory("/foo/bar/");
42 }
OLDNEW
« no previous file with comments | « sdk/lib/io/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698