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 pathos_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:pathos/path.dart' as path; | 8 import 'package:path/path.dart' as path; |
9 | 9 |
10 main() { | 10 main() { |
11 var builder = new path.Builder(style: path.Style.windows, | 11 var builder = new path.Builder(style: path.Style.windows, |
12 root: r'C:\root\path'); | 12 root: r'C:\root\path'); |
13 | 13 |
14 if (new path.Builder().style == path.Style.windows) { | 14 if (new path.Builder().style == path.Style.windows) { |
15 group('absolute', () { | 15 group('absolute', () { |
16 expect(path.absolute(r'a\b.txt'), path.join(path.current, r'a\b.txt')); | 16 expect(path.absolute(r'a\b.txt'), path.join(path.current, r'a\b.txt')); |
17 expect(path.absolute(r'C:\a\b.txt'), r'C:\a\b.txt'); | 17 expect(path.absolute(r'C:\a\b.txt'), r'C:\a\b.txt'); |
18 expect(path.absolute(r'\\a\b.txt'), r'\\a\b.txt'); | 18 expect(path.absolute(r'\\a\b.txt'), r'\\a\b.txt'); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 Uri.parse('file:///C:/path/to/foo/')); | 469 Uri.parse('file:///C:/path/to/foo/')); |
470 expect(builder.toUri(r'C:\'), Uri.parse('file:///C:/')); | 470 expect(builder.toUri(r'C:\'), Uri.parse('file:///C:/')); |
471 expect(builder.toUri(r'\\hostname\'), Uri.parse('file://hostname/')); | 471 expect(builder.toUri(r'\\hostname\'), Uri.parse('file://hostname/')); |
472 expect(builder.toUri(r'foo\bar'), Uri.parse('foo/bar')); | 472 expect(builder.toUri(r'foo\bar'), Uri.parse('foo/bar')); |
473 expect(builder.toUri(r'C:\path\to\foo#bar'), | 473 expect(builder.toUri(r'C:\path\to\foo#bar'), |
474 Uri.parse('file:///C:/path/to/foo%23bar')); | 474 Uri.parse('file:///C:/path/to/foo%23bar')); |
475 expect(builder.toUri(r'\\hostname\path\to\foo#bar'), | 475 expect(builder.toUri(r'\\hostname\path\to\foo#bar'), |
476 Uri.parse('file://hostname/path/to/foo%23bar')); | 476 Uri.parse('file://hostname/path/to/foo%23bar')); |
477 }); | 477 }); |
478 } | 478 } |
OLD | NEW |