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 import 'utils.dart'; | 10 import 'utils.dart'; |
(...skipping 23 matching lines...) Expand all Loading... |
34 }); | 34 }); |
35 | 35 |
36 test('rootPrefix', () { | 36 test('rootPrefix', () { |
37 expect(context.rootPrefix(''), ''); | 37 expect(context.rootPrefix(''), ''); |
38 expect(context.rootPrefix('a'), ''); | 38 expect(context.rootPrefix('a'), ''); |
39 expect(context.rootPrefix(r'a\b'), ''); | 39 expect(context.rootPrefix(r'a\b'), ''); |
40 expect(context.rootPrefix(r'C:\a\c'), r'C:\'); | 40 expect(context.rootPrefix(r'C:\a\c'), r'C:\'); |
41 expect(context.rootPrefix('C:\\'), r'C:\'); | 41 expect(context.rootPrefix('C:\\'), r'C:\'); |
42 expect(context.rootPrefix('C:/'), 'C:/'); | 42 expect(context.rootPrefix('C:/'), 'C:/'); |
43 expect(context.rootPrefix(r'\\server\share\a\b'), r'\\server\share'); | 43 expect(context.rootPrefix(r'\\server\share\a\b'), r'\\server\share'); |
| 44 expect(context.rootPrefix(r'\\server\share'), r'\\server\share'); |
| 45 expect(context.rootPrefix(r'\\server\'), r'\\server\'); |
| 46 expect(context.rootPrefix(r'\\server'), r'\\server'); |
44 expect(context.rootPrefix(r'\a\b'), r'\'); | 47 expect(context.rootPrefix(r'\a\b'), r'\'); |
45 expect(context.rootPrefix(r'/a/b'), r'/'); | 48 expect(context.rootPrefix(r'/a/b'), r'/'); |
46 expect(context.rootPrefix(r'\'), r'\'); | 49 expect(context.rootPrefix(r'\'), r'\'); |
47 expect(context.rootPrefix(r'/'), r'/'); | 50 expect(context.rootPrefix(r'/'), r'/'); |
48 }); | 51 }); |
49 | 52 |
50 test('dirname', () { | 53 test('dirname', () { |
51 expect(context.dirname(r''), '.'); | 54 expect(context.dirname(r''), '.'); |
52 expect(context.dirname(r'a'), '.'); | 55 expect(context.dirname(r'a'), '.'); |
53 expect(context.dirname(r'a\b'), 'a'); | 56 expect(context.dirname(r'a\b'), 'a'); |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 667 |
665 test('with a root-relative URI', () { | 668 test('with a root-relative URI', () { |
666 expect(context.prettyUri('/D:/a/b'), r'D:\a\b'); | 669 expect(context.prettyUri('/D:/a/b'), r'D:\a\b'); |
667 }); | 670 }); |
668 | 671 |
669 test('with a Uri object', () { | 672 test('with a Uri object', () { |
670 expect(context.prettyUri(Uri.parse('a/b')), r'a\b'); | 673 expect(context.prettyUri(Uri.parse('a/b')), r'a\b'); |
671 }); | 674 }); |
672 }); | 675 }); |
673 } | 676 } |
OLD | NEW |