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 import 'package:unittest/unittest.dart'; | 5 import 'package:unittest/unittest.dart'; |
6 import 'package:path/path.dart' as path; | 6 import 'package:path/path.dart' as path; |
7 | 7 |
8 main() { | 8 main() { |
9 group('path.Style', () { | 9 group('path.Style', () { |
10 test('name', () { | 10 test('name', () { |
11 expect(path.Style.posix.name, 'posix'); | 11 expect(path.Style.posix.name, 'posix'); |
12 expect(path.Style.windows.name, 'windows'); | 12 expect(path.Style.windows.name, 'windows'); |
13 }); | 13 }); |
14 | 14 |
15 test('separator', () { | 15 test('separator', () { |
16 expect(path.Style.posix.separator, '/'); | 16 expect(path.Style.posix.separator, '/'); |
17 expect(path.Style.windows.separator, '\\'); | 17 expect(path.Style.windows.separator, '\\'); |
18 }); | 18 }); |
19 | 19 |
20 test('toString()', () { | 20 test('toString()', () { |
21 expect(path.Style.posix.toString(), 'posix'); | 21 expect(path.Style.posix.toString(), 'posix'); |
22 expect(path.Style.windows.toString(), 'windows'); | 22 expect(path.Style.windows.toString(), 'windows'); |
23 }); | 23 }); |
24 }); | 24 }); |
25 | 25 |
26 group('new Builder()', () { | 26 group('new Context()', () { |
27 test('uses the given root directory', () { | 27 test('uses the given current directory', () { |
28 var builder = new path.Builder(root: '/a/b/c'); | 28 var context = new path.Context(current: '/a/b/c'); |
29 expect(builder.root, '/a/b/c'); | 29 expect(context.current, '/a/b/c'); |
30 }); | 30 }); |
31 | 31 |
32 test('uses the given style', () { | 32 test('uses the given style', () { |
33 var builder = new path.Builder(style: path.Style.windows); | 33 var context = new path.Context(style: path.Style.windows); |
34 expect(builder.style, path.Style.windows); | 34 expect(context.style, path.Style.windows); |
35 }); | 35 }); |
36 }); | 36 }); |
37 | 37 |
38 test('posix is a default Builder for the POSIX style', () { | 38 test('posix is a default Context for the POSIX style', () { |
39 expect(path.posix.style, path.Style.posix); | 39 expect(path.posix.style, path.Style.posix); |
40 expect(path.posix.root, "."); | 40 expect(path.posix.current, "."); |
41 }); | 41 }); |
42 | 42 |
43 test('windows is a default Builder for the Windows style', () { | 43 test('windows is a default Context for the Windows style', () { |
44 expect(path.windows.style, path.Style.windows); | 44 expect(path.windows.style, path.Style.windows); |
45 expect(path.windows.root, "."); | 45 expect(path.windows.current, "."); |
46 }); | 46 }); |
47 | 47 |
48 test('url is a default Builder for the URL style', () { | 48 test('url is a default Context for the URL style', () { |
49 expect(path.url.style, path.Style.url); | 49 expect(path.url.style, path.Style.url); |
50 expect(path.url.root, "."); | 50 expect(path.url.current, "."); |
51 }); | 51 }); |
52 } | 52 } |
OLD | NEW |