OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 @TestOn('vm') |
| 6 |
5 import 'dart:io' as io; | 7 import 'dart:io' as io; |
6 | 8 |
7 import 'package:unittest/unittest.dart'; | 9 import 'package:test/test.dart'; |
8 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
9 | 11 |
10 main() { | 12 main() { |
11 group('new Context()', () { | 13 group('new Context()', () { |
12 test('uses the current directory if root and style are omitted', () { | 14 test('uses the current directory if root and style are omitted', () { |
13 var context = new path.Context(); | 15 var context = new path.Context(); |
14 expect(context.current, io.Directory.current.path); | 16 expect(context.current, io.Directory.current.path); |
15 }); | 17 }); |
16 | 18 |
17 test('uses "." if root is omitted', () { | 19 test('uses "." if root is omitted', () { |
(...skipping 29 matching lines...) Expand all Loading... |
47 io.Directory.current = path.dirname(dir); | 49 io.Directory.current = path.dirname(dir); |
48 expect(path.normalize(path.absolute('foo/bar')), | 50 expect(path.normalize(path.absolute('foo/bar')), |
49 equals(path.normalize(path.join(dir, '../foo/bar')))); | 51 equals(path.normalize(path.join(dir, '../foo/bar')))); |
50 expect(path.normalize(path.absolute('foo/bar')), | 52 expect(path.normalize(path.absolute('foo/bar')), |
51 equals(path.normalize(path.context.join(dir, '../foo/bar')))); | 53 equals(path.normalize(path.context.join(dir, '../foo/bar')))); |
52 } finally { | 54 } finally { |
53 io.Directory.current = dir; | 55 io.Directory.current = dir; |
54 } | 56 } |
55 }); | 57 }); |
56 } | 58 } |
OLD | NEW |