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