OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.test.src.util.absolute_path_test; | 5 library analyzer.test.src.util.absolute_path_test; |
6 | 6 |
7 import 'package:analyzer/src/util/absolute_path.dart'; | 7 import 'package:analyzer/src/util/absolute_path.dart'; |
| 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
8 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
9 | 10 |
10 import '../../reflective_tests.dart'; | |
11 import '../../utils.dart'; | 11 import '../../utils.dart'; |
12 | 12 |
13 main() { | 13 main() { |
14 initializeTestEnvironment(); | 14 initializeTestEnvironment(); |
15 runReflectiveTests(AbsolutePathContextPosixTest); | 15 defineReflectiveTests(AbsolutePathContextPosixTest); |
16 runReflectiveTests(AbsolutePathContextWindowsTest); | 16 defineReflectiveTests(AbsolutePathContextWindowsTest); |
17 } | 17 } |
18 | 18 |
19 @reflectiveTest | 19 @reflectiveTest |
20 class AbsolutePathContextPosixTest { | 20 class AbsolutePathContextPosixTest { |
21 AbsolutePathContext context = new AbsolutePathContext(false); | 21 AbsolutePathContext context = new AbsolutePathContext(false); |
22 | 22 |
23 void test_append() { | 23 void test_append() { |
24 expect(context.append(r'/path/to', r'foo.dart'), r'/path/to/foo.dart'); | 24 expect(context.append(r'/path/to', r'foo.dart'), r'/path/to/foo.dart'); |
25 } | 25 } |
26 | 26 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 expect(context.split(r'C:\path\to\foo'), [r'C:', r'path', r'to', r'foo']); | 133 expect(context.split(r'C:\path\to\foo'), [r'C:', r'path', r'to', r'foo']); |
134 expect(context.split(r'C:\path'), [r'C:', r'path']); | 134 expect(context.split(r'C:\path'), [r'C:', r'path']); |
135 } | 135 } |
136 | 136 |
137 void test_suffix() { | 137 void test_suffix() { |
138 expect( | 138 expect( |
139 context.suffix(r'C:\root\path', r'C:\root\path\a\b.dart'), r'a\b.dart'); | 139 context.suffix(r'C:\root\path', r'C:\root\path\a\b.dart'), r'a\b.dart'); |
140 expect(context.suffix(r'C:\root\path', r'C:\root\other.dart'), isNull); | 140 expect(context.suffix(r'C:\root\path', r'C:\root\other.dart'), isNull); |
141 } | 141 } |
142 } | 142 } |
OLD | NEW |