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

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

Issue 20372002: Ignore all trailing separators in path.extension. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/path.dart ('k') | pkg/path/test/url_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 library path.test.posix_test; 5 library path.test.posix_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 main() { 10 main() {
(...skipping 13 matching lines...) Expand all
24 test('extension', () { 24 test('extension', () {
25 expect(builder.extension(''), ''); 25 expect(builder.extension(''), '');
26 expect(builder.extension('.'), ''); 26 expect(builder.extension('.'), '');
27 expect(builder.extension('..'), ''); 27 expect(builder.extension('..'), '');
28 expect(builder.extension('foo.dart'), '.dart'); 28 expect(builder.extension('foo.dart'), '.dart');
29 expect(builder.extension('foo.dart.js'), '.js'); 29 expect(builder.extension('foo.dart.js'), '.js');
30 expect(builder.extension('a.b/c'), ''); 30 expect(builder.extension('a.b/c'), '');
31 expect(builder.extension('a.b/c.d'), '.d'); 31 expect(builder.extension('a.b/c.d'), '.d');
32 expect(builder.extension('~/.bashrc'), ''); 32 expect(builder.extension('~/.bashrc'), '');
33 expect(builder.extension(r'a.b\c'), r'.b\c'); 33 expect(builder.extension(r'a.b\c'), r'.b\c');
34 expect(builder.extension('foo.dart/'), '.dart');
35 expect(builder.extension('foo.dart//'), '.dart');
34 }); 36 });
35 37
36 test('rootPrefix', () { 38 test('rootPrefix', () {
37 expect(builder.rootPrefix(''), ''); 39 expect(builder.rootPrefix(''), '');
38 expect(builder.rootPrefix('a'), ''); 40 expect(builder.rootPrefix('a'), '');
39 expect(builder.rootPrefix('a/b'), ''); 41 expect(builder.rootPrefix('a/b'), '');
40 expect(builder.rootPrefix('/a/c'), '/'); 42 expect(builder.rootPrefix('/a/c'), '/');
41 expect(builder.rootPrefix('/'), '/'); 43 expect(builder.rootPrefix('/'), '/');
42 }); 44 });
43 45
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 470
469 test('toUri', () { 471 test('toUri', () {
470 expect(builder.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo')); 472 expect(builder.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo'));
471 expect(builder.toUri('/path/to/foo/'), Uri.parse('file:///path/to/foo/')); 473 expect(builder.toUri('/path/to/foo/'), Uri.parse('file:///path/to/foo/'));
472 expect(builder.toUri('/'), Uri.parse('file:///')); 474 expect(builder.toUri('/'), Uri.parse('file:///'));
473 expect(builder.toUri('foo/bar'), Uri.parse('foo/bar')); 475 expect(builder.toUri('foo/bar'), Uri.parse('foo/bar'));
474 expect(builder.toUri('/path/to/foo#bar'), 476 expect(builder.toUri('/path/to/foo#bar'),
475 Uri.parse('file:///path/to/foo%23bar')); 477 Uri.parse('file:///path/to/foo%23bar'));
476 }); 478 });
477 } 479 }
OLDNEW
« no previous file with comments | « pkg/path/lib/path.dart ('k') | pkg/path/test/url_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698