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

Side by Side Diff: pkg/path/test/windows_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, 5 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 main() { 10 main() {
(...skipping 17 matching lines...) Expand all
28 expect(builder.extension('.'), ''); 28 expect(builder.extension('.'), '');
29 expect(builder.extension('..'), ''); 29 expect(builder.extension('..'), '');
30 expect(builder.extension('a/..'), ''); 30 expect(builder.extension('a/..'), '');
31 expect(builder.extension('foo.dart'), '.dart'); 31 expect(builder.extension('foo.dart'), '.dart');
32 expect(builder.extension('foo.dart.js'), '.js'); 32 expect(builder.extension('foo.dart.js'), '.js');
33 expect(builder.extension('foo bar\gule fisk.dart.js'), '.js'); 33 expect(builder.extension('foo bar\gule fisk.dart.js'), '.js');
34 expect(builder.extension(r'a.b\c'), ''); 34 expect(builder.extension(r'a.b\c'), '');
35 expect(builder.extension('a.b/c.d'), '.d'); 35 expect(builder.extension('a.b/c.d'), '.d');
36 expect(builder.extension(r'~\.bashrc'), ''); 36 expect(builder.extension(r'~\.bashrc'), '');
37 expect(builder.extension(r'a.b/c'), r''); 37 expect(builder.extension(r'a.b/c'), r'');
38 expect(builder.extension(r'foo.dart\'), '.dart');
39 expect(builder.extension(r'foo.dart\\'), '.dart');
38 }); 40 });
39 41
40 test('rootPrefix', () { 42 test('rootPrefix', () {
41 expect(builder.rootPrefix(''), ''); 43 expect(builder.rootPrefix(''), '');
42 expect(builder.rootPrefix('a'), ''); 44 expect(builder.rootPrefix('a'), '');
43 expect(builder.rootPrefix(r'a\b'), ''); 45 expect(builder.rootPrefix(r'a\b'), '');
44 expect(builder.rootPrefix(r'C:\a\c'), r'C:\'); 46 expect(builder.rootPrefix(r'C:\a\c'), r'C:\');
45 expect(builder.rootPrefix('C:\\'), r'C:\'); 47 expect(builder.rootPrefix('C:\\'), r'C:\');
46 expect(builder.rootPrefix('C:/'), 'C:/'); 48 expect(builder.rootPrefix('C:/'), 'C:/');
47 49
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 Uri.parse('file:///C:/path/to/foo/')); 516 Uri.parse('file:///C:/path/to/foo/'));
515 expect(builder.toUri(r'C:\'), Uri.parse('file:///C:/')); 517 expect(builder.toUri(r'C:\'), Uri.parse('file:///C:/'));
516 expect(builder.toUri(r'\\hostname\'), Uri.parse('file://hostname/')); 518 expect(builder.toUri(r'\\hostname\'), Uri.parse('file://hostname/'));
517 expect(builder.toUri(r'foo\bar'), Uri.parse('foo/bar')); 519 expect(builder.toUri(r'foo\bar'), Uri.parse('foo/bar'));
518 expect(builder.toUri(r'C:\path\to\foo#bar'), 520 expect(builder.toUri(r'C:\path\to\foo#bar'),
519 Uri.parse('file:///C:/path/to/foo%23bar')); 521 Uri.parse('file:///C:/path/to/foo%23bar'));
520 expect(builder.toUri(r'\\hostname\path\to\foo#bar'), 522 expect(builder.toUri(r'\\hostname\path\to\foo#bar'),
521 Uri.parse('file://hostname/path/to/foo%23bar')); 523 Uri.parse('file://hostname/path/to/foo%23bar'));
522 }); 524 });
523 } 525 }
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