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

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

Issue 439223002: Add InternalStyle:rootLength to implement isAbsolute and rootPrefix. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add windows test to 'document' \\server root prefix. Created 6 years, 4 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 23 matching lines...) Expand all
34 }); 34 });
35 35
36 test('rootPrefix', () { 36 test('rootPrefix', () {
37 expect(context.rootPrefix(''), ''); 37 expect(context.rootPrefix(''), '');
38 expect(context.rootPrefix('a'), ''); 38 expect(context.rootPrefix('a'), '');
39 expect(context.rootPrefix(r'a\b'), ''); 39 expect(context.rootPrefix(r'a\b'), '');
40 expect(context.rootPrefix(r'C:\a\c'), r'C:\'); 40 expect(context.rootPrefix(r'C:\a\c'), r'C:\');
41 expect(context.rootPrefix('C:\\'), r'C:\'); 41 expect(context.rootPrefix('C:\\'), r'C:\');
42 expect(context.rootPrefix('C:/'), 'C:/'); 42 expect(context.rootPrefix('C:/'), 'C:/');
43 expect(context.rootPrefix(r'\\server\share\a\b'), r'\\server\share'); 43 expect(context.rootPrefix(r'\\server\share\a\b'), r'\\server\share');
44 expect(context.rootPrefix(r'\\server\share'), r'\\server\share');
45 expect(context.rootPrefix(r'\\server\'), r'\\server\');
46 expect(context.rootPrefix(r'\\server'), r'\\server');
44 expect(context.rootPrefix(r'\a\b'), r'\'); 47 expect(context.rootPrefix(r'\a\b'), r'\');
45 expect(context.rootPrefix(r'/a/b'), r'/'); 48 expect(context.rootPrefix(r'/a/b'), r'/');
46 expect(context.rootPrefix(r'\'), r'\'); 49 expect(context.rootPrefix(r'\'), r'\');
47 expect(context.rootPrefix(r'/'), r'/'); 50 expect(context.rootPrefix(r'/'), r'/');
48 }); 51 });
49 52
50 test('dirname', () { 53 test('dirname', () {
51 expect(context.dirname(r''), '.'); 54 expect(context.dirname(r''), '.');
52 expect(context.dirname(r'a'), '.'); 55 expect(context.dirname(r'a'), '.');
53 expect(context.dirname(r'a\b'), 'a'); 56 expect(context.dirname(r'a\b'), 'a');
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 667
665 test('with a root-relative URI', () { 668 test('with a root-relative URI', () {
666 expect(context.prettyUri('/D:/a/b'), r'D:\a\b'); 669 expect(context.prettyUri('/D:/a/b'), r'D:\a\b');
667 }); 670 });
668 671
669 test('with a Uri object', () { 672 test('with a Uri object', () {
670 expect(context.prettyUri(Uri.parse('a/b')), r'a\b'); 673 expect(context.prettyUri(Uri.parse('a/b')), r'a\b');
671 }); 674 });
672 }); 675 });
673 } 676 }
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