OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |