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; | 5 library path_test; |
6 | 6 |
7 import 'dart:io' as io; | 7 import 'dart:io' as io; |
8 | 8 |
9 import '../../../../pkg/unittest/lib/unittest.dart'; | 9 // TODO(rnystrom): Use "package:" path when #7491 is fixed. |
10 import '../../../pub/path.dart' as path; | 10 import '../../unittest/lib/unittest.dart'; |
| 11 import '../lib/path.dart' as path; |
11 | 12 |
12 main() { | 13 main() { |
13 var builder = new path.Builder(style: path.Style.posix, root: '/root/path'); | 14 var builder = new path.Builder(style: path.Style.posix, root: '/root/path'); |
14 | 15 |
15 if (new path.Builder().style == path.Style.posix) { | 16 if (new path.Builder().style == path.Style.posix) { |
16 group('absolute', () { | 17 group('absolute', () { |
17 expect(path.absolute('a/b.txt'), path.join(path.current, 'a/b.txt')); | 18 expect(path.absolute('a/b.txt'), path.join(path.current, 'a/b.txt')); |
18 expect(path.absolute('/a/b.txt'), '/a/b.txt'); | 19 expect(path.absolute('/a/b.txt'), '/a/b.txt'); |
19 }); | 20 }); |
20 } | 21 } |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 expect(builder.withoutExtension('a/'), 'a/'); | 353 expect(builder.withoutExtension('a/'), 'a/'); |
353 expect(builder.withoutExtension('a/b/'), 'a/b/'); | 354 expect(builder.withoutExtension('a/b/'), 'a/b/'); |
354 expect(builder.withoutExtension('a/.'), 'a/.'); | 355 expect(builder.withoutExtension('a/.'), 'a/.'); |
355 expect(builder.withoutExtension('a/.b'), 'a/.b'); | 356 expect(builder.withoutExtension('a/.b'), 'a/.b'); |
356 expect(builder.withoutExtension('a.b/c'), 'a.b/c'); | 357 expect(builder.withoutExtension('a.b/c'), 'a.b/c'); |
357 expect(builder.withoutExtension(r'a.b\c'), r'a'); | 358 expect(builder.withoutExtension(r'a.b\c'), r'a'); |
358 expect(builder.withoutExtension(r'a/b\c'), r'a/b\c'); | 359 expect(builder.withoutExtension(r'a/b\c'), r'a/b\c'); |
359 expect(builder.withoutExtension(r'a/b\c.d'), r'a/b\c'); | 360 expect(builder.withoutExtension(r'a/b\c.d'), r'a/b\c'); |
360 }); | 361 }); |
361 } | 362 } |
OLD | NEW |