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 // TODO(rnystrom): Use "package:" path when #7491 is fixed. | 9 import 'package:unittest/unittest.dart'; |
10 import '../../unittest/lib/unittest.dart'; | 10 import 'package:path/path.dart' as path; |
11 import '../lib/path.dart' as path; | |
12 | 11 |
13 main() { | 12 main() { |
14 var builder = new path.Builder(style: path.Style.windows, | 13 var builder = new path.Builder(style: path.Style.windows, |
15 root: r'C:\root\path'); | 14 root: r'C:\root\path'); |
16 | 15 |
17 if (new path.Builder().style == path.Style.windows) { | 16 if (new path.Builder().style == path.Style.windows) { |
18 group('absolute', () { | 17 group('absolute', () { |
19 expect(path.absolute(r'a\b.txt'), path.join(path.current, r'a\b.txt')); | 18 expect(path.absolute(r'a\b.txt'), path.join(path.current, r'a\b.txt')); |
20 expect(path.absolute(r'C:\a\b.txt'), r'C:\a\b.txt'); | 19 expect(path.absolute(r'C:\a\b.txt'), r'C:\a\b.txt'); |
21 expect(path.absolute(r'\\a\b.txt'), r'\\a\b.txt'); | 20 expect(path.absolute(r'\\a\b.txt'), r'\\a\b.txt'); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 expect(builder.withoutExtension(r'a\.'), r'a\.'); | 397 expect(builder.withoutExtension(r'a\.'), r'a\.'); |
399 expect(builder.withoutExtension(r'a\.b'), r'a\.b'); | 398 expect(builder.withoutExtension(r'a\.b'), r'a\.b'); |
400 expect(builder.withoutExtension(r'a.b\c'), r'a.b\c'); | 399 expect(builder.withoutExtension(r'a.b\c'), r'a.b\c'); |
401 expect(builder.withoutExtension(r'a/b.c/d'), r'a/b.c/d'); | 400 expect(builder.withoutExtension(r'a/b.c/d'), r'a/b.c/d'); |
402 expect(builder.withoutExtension(r'a\b/c'), r'a\b/c'); | 401 expect(builder.withoutExtension(r'a\b/c'), r'a\b/c'); |
403 expect(builder.withoutExtension(r'a\b/c.d'), r'a\b/c'); | 402 expect(builder.withoutExtension(r'a\b/c.d'), r'a\b/c'); |
404 expect(builder.withoutExtension(r'a.b/c'), r'a.b/c'); | 403 expect(builder.withoutExtension(r'a.b/c'), r'a.b/c'); |
405 expect(builder.withoutExtension(r'a\b.c\'), r'a\b\'); | 404 expect(builder.withoutExtension(r'a\b.c\'), r'a\b\'); |
406 }); | 405 }); |
407 } | 406 } |
OLD | NEW |