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

Side by Side Diff: pkg/path/test/windows_test.dart

Issue 296233002: Add a path.formatUri method and release path 1.2.0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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 | « pkg/path/test/url_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library path.test.windows_test; 5 library path.test.windows_test;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'package:path/path.dart' as path; 8 import 'package:path/path.dart' as path;
9 9
10 import 'utils.dart'; 10 import 'utils.dart';
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 expect(context.toUri(r'foo\bar'), Uri.parse('foo/bar')); 633 expect(context.toUri(r'foo\bar'), Uri.parse('foo/bar'));
634 expect(context.toUri(r'C:\path\to\foo#bar'), 634 expect(context.toUri(r'C:\path\to\foo#bar'),
635 Uri.parse('file:///C:/path/to/foo%23bar')); 635 Uri.parse('file:///C:/path/to/foo%23bar'));
636 expect(context.toUri(r'\\server\share\path\to\foo#bar'), 636 expect(context.toUri(r'\\server\share\path\to\foo#bar'),
637 Uri.parse('file://server/share/path/to/foo%23bar')); 637 Uri.parse('file://server/share/path/to/foo%23bar'));
638 expect(context.toUri(r'C:\_{_}_`_^_ _"_%_'), 638 expect(context.toUri(r'C:\_{_}_`_^_ _"_%_'),
639 Uri.parse('file:///C:/_%7B_%7D_%60_%5E_%20_%22_%25_')); 639 Uri.parse('file:///C:/_%7B_%7D_%60_%5E_%20_%22_%25_'));
640 expect(context.toUri(r'_{_}_`_^_ _"_%_'), 640 expect(context.toUri(r'_{_}_`_^_ _"_%_'),
641 Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')); 641 Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_'));
642 }); 642 });
643
644 group('prettyUri', () {
645 test('with a file: URI', () {
646 expect(context.prettyUri('file:///C:/root/path/a/b'), r'a\b');
647 expect(context.prettyUri('file:///C:/root/path/a/../b'), r'b');
648 expect(context.prettyUri('file:///C:/other/path/a/b'),
649 r'C:\other\path\a\b');
650 expect(context.prettyUri('file:///D:/root/path/a/b'),
651 r'D:\root\path\a\b');
652 expect(context.prettyUri('file:///C:/root/other'),
653 r'..\other');
654 });
655
656 test('with an http: URI', () {
657 expect(context.prettyUri('http://dartlang.org/a/b'),
658 'http://dartlang.org/a/b');
659 });
660
661 test('with a relative URI', () {
662 expect(context.prettyUri('a/b'), r'a\b');
663 });
664
665 test('with a root-relative URI', () {
666 expect(context.prettyUri('/D:/a/b'), r'D:\a\b');
667 });
668
669 test('with a Uri object', () {
670 expect(context.prettyUri(Uri.parse('a/b')), r'a\b');
671 });
672 });
643 } 673 }
OLDNEW
« no previous file with comments | « pkg/path/test/url_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698