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

Side by Side Diff: tests/lib/platform/uri_test.dart

Issue 43773004: dart:platform | Remove isWindows, isLinux, isAndroid, isMacOS from dart:platform. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comment about removing dart:io Platform 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
« no previous file with comments | « tests/lib/platform/path_separator_test.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
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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:platform" as platform; 6 import "dart:platform" as platform;
7 7
8 main() { 8 main() {
9 if (platform.isWindows) { 9 if (platform.operatingSystem == 'windows') {
10 Expect.equals("a\\b", Uri.parse("a/b").toFilePath()); 10 Expect.equals("a\\b", Uri.parse("a/b").toFilePath());
11 Expect.equals("a\\b\\", Uri.parse("a/b/").toFilePath()); 11 Expect.equals("a\\b\\", Uri.parse("a/b/").toFilePath());
12 Expect.equals("a b", Uri.parse("a%20b").toFilePath()); 12 Expect.equals("a b", Uri.parse("a%20b").toFilePath());
13 Expect.equals("\\a b", Uri.parse("file:///a%20b").toFilePath()); 13 Expect.equals("\\a b", Uri.parse("file:///a%20b").toFilePath());
14 Expect.equals("\\a\\b", Uri.parse("file:///a/b").toFilePath()); 14 Expect.equals("\\a\\b", Uri.parse("file:///a/b").toFilePath());
15 Expect.equals("C:\\", Uri.parse("file:///C:").toFilePath()); 15 Expect.equals("C:\\", Uri.parse("file:///C:").toFilePath());
16 Expect.equals("C:\\", Uri.parse("file:///C:/").toFilePath()); 16 Expect.equals("C:\\", Uri.parse("file:///C:/").toFilePath());
17 Expect.equals("\\\\host\\a\\b", Uri.parse("file://host/a/b").toFilePath()); 17 Expect.equals("\\\\host\\a\\b", Uri.parse("file://host/a/b").toFilePath());
18 18
19 Expect.equals("a\\b", new Uri.file("a/b").toFilePath()); 19 Expect.equals("a\\b", new Uri.file("a/b").toFilePath());
(...skipping 10 matching lines...) Expand all
30 Expect.equals("/a/b", Uri.parse("file:///a/b").toFilePath()); 30 Expect.equals("/a/b", Uri.parse("file:///a/b").toFilePath());
31 Expect.equals("/C:", Uri.parse("file:///C:").toFilePath()); 31 Expect.equals("/C:", Uri.parse("file:///C:").toFilePath());
32 Expect.equals("/C:/", Uri.parse("file:///C:/").toFilePath()); 32 Expect.equals("/C:/", Uri.parse("file:///C:/").toFilePath());
33 Expect.throws(() => Uri.parse("file://host/a/b").toFilePath(), 33 Expect.throws(() => Uri.parse("file://host/a/b").toFilePath(),
34 (e) => e is UnsupportedError); 34 (e) => e is UnsupportedError);
35 35
36 Expect.equals("a/b", new Uri.file("a/b").toFilePath()); 36 Expect.equals("a/b", new Uri.file("a/b").toFilePath());
37 Expect.equals("a\\b", new Uri.file("a\\b").toFilePath()); 37 Expect.equals("a\\b", new Uri.file("a\\b").toFilePath());
38 } 38 }
39 } 39 }
OLDNEW
« no previous file with comments | « tests/lib/platform/path_separator_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698