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_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: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.posix, root: '/root/path'); | 11 var builder = new path.Builder(style: path.Style.posix, root: '/root/path'); |
12 | 12 |
13 if (new path.Builder().style == path.Style.posix) { | 13 if (new path.Builder().style == path.Style.posix) { |
14 group('absolute', () { | 14 group('absolute', () { |
15 expect(path.absolute('a/b.txt'), path.join(path.current, 'a/b.txt')); | 15 expect(path.absolute('a/b.txt'), path.join(path.current, 'a/b.txt')); |
16 expect(path.absolute('/a/b.txt'), '/a/b.txt'); | 16 expect(path.absolute('/a/b.txt'), '/a/b.txt'); |
17 }); | 17 }); |
18 } | 18 } |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 415 |
416 test('toUri', () { | 416 test('toUri', () { |
417 expect(builder.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo')); | 417 expect(builder.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo')); |
418 expect(builder.toUri('/path/to/foo/'), Uri.parse('file:///path/to/foo/')); | 418 expect(builder.toUri('/path/to/foo/'), Uri.parse('file:///path/to/foo/')); |
419 expect(builder.toUri('/'), Uri.parse('file:///')); | 419 expect(builder.toUri('/'), Uri.parse('file:///')); |
420 expect(builder.toUri('foo/bar'), Uri.parse('foo/bar')); | 420 expect(builder.toUri('foo/bar'), Uri.parse('foo/bar')); |
421 expect(builder.toUri('/path/to/foo#bar'), | 421 expect(builder.toUri('/path/to/foo#bar'), |
422 Uri.parse('file:///path/to/foo%23bar')); | 422 Uri.parse('file:///path/to/foo%23bar')); |
423 }); | 423 }); |
424 } | 424 } |
OLD | NEW |