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

Side by Side Diff: pkg/path/test/url_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/lib/src/style/windows.dart ('k') | pkg/path/test/windows_test.dart » ('j') | 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 import 'package:unittest/unittest.dart'; 5 import 'package:unittest/unittest.dart';
6 import 'package:path/path.dart' as path; 6 import 'package:path/path.dart' as path;
7 7
8 main() { 8 main() {
9 var context = new path.Context(style: path.Style.url, 9 var context = new path.Context(style: path.Style.url,
10 current: 'http://dartlang.org/root/path'); 10 current: 'http://dartlang.org/root/path');
(...skipping 19 matching lines...) Expand all
30 expect(context.rootPrefix('a/b'), ''); 30 expect(context.rootPrefix('a/b'), '');
31 expect(context.rootPrefix('http://dartlang.org/a/c'), 31 expect(context.rootPrefix('http://dartlang.org/a/c'),
32 'http://dartlang.org'); 32 'http://dartlang.org');
33 expect(context.rootPrefix('file:///a/c'), 'file://'); 33 expect(context.rootPrefix('file:///a/c'), 'file://');
34 expect(context.rootPrefix('/a/c'), '/'); 34 expect(context.rootPrefix('/a/c'), '/');
35 expect(context.rootPrefix('http://dartlang.org/'), 'http://dartlang.org'); 35 expect(context.rootPrefix('http://dartlang.org/'), 'http://dartlang.org');
36 expect(context.rootPrefix('file:///'), 'file://'); 36 expect(context.rootPrefix('file:///'), 'file://');
37 expect(context.rootPrefix('http://dartlang.org'), 'http://dartlang.org'); 37 expect(context.rootPrefix('http://dartlang.org'), 'http://dartlang.org');
38 expect(context.rootPrefix('file://'), 'file://'); 38 expect(context.rootPrefix('file://'), 'file://');
39 expect(context.rootPrefix('/'), '/'); 39 expect(context.rootPrefix('/'), '/');
40 expect(context.rootPrefix('foo/bar://'), '');
40 }); 41 });
41 42
42 test('dirname', () { 43 test('dirname', () {
43 expect(context.dirname(''), '.'); 44 expect(context.dirname(''), '.');
44 expect(context.dirname('a'), '.'); 45 expect(context.dirname('a'), '.');
45 expect(context.dirname('a/b'), 'a'); 46 expect(context.dirname('a/b'), 'a');
46 expect(context.dirname('a/b/c'), 'a/b'); 47 expect(context.dirname('a/b/c'), 'a/b');
47 expect(context.dirname('a/b.c'), 'a'); 48 expect(context.dirname('a/b.c'), 'a');
48 expect(context.dirname('a/'), '.'); 49 expect(context.dirname('a/'), '.');
49 expect(context.dirname('a/.'), 'a'); 50 expect(context.dirname('a/.'), 'a');
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
765 766
766 test('with a root-relative URI', () { 767 test('with a root-relative URI', () {
767 expect(context.prettyUri('/a/b'), '/a/b'); 768 expect(context.prettyUri('/a/b'), '/a/b');
768 }); 769 });
769 770
770 test('with a Uri object', () { 771 test('with a Uri object', () {
771 expect(context.prettyUri(Uri.parse('a/b')), 'a/b'); 772 expect(context.prettyUri(Uri.parse('a/b')), 'a/b');
772 }); 773 });
773 }); 774 });
774 } 775 }
OLDNEW
« no previous file with comments | « pkg/path/lib/src/style/windows.dart ('k') | pkg/path/test/windows_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698