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/test.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
10 | 10 |
11 import '../../utils.dart'; | |
12 | |
13 main() { | 11 main() { |
14 initializeTestEnvironment(); | |
15 defineReflectiveSuite(() { | 12 defineReflectiveSuite(() { |
16 defineReflectiveTests(AbsolutePathContextPosixTest); | 13 defineReflectiveTests(AbsolutePathContextPosixTest); |
17 defineReflectiveTests(AbsolutePathContextWindowsTest); | 14 defineReflectiveTests(AbsolutePathContextWindowsTest); |
18 }); | 15 }); |
19 } | 16 } |
20 | 17 |
21 @reflectiveTest | 18 @reflectiveTest |
22 class AbsolutePathContextPosixTest { | 19 class AbsolutePathContextPosixTest { |
23 AbsolutePathContext context = new AbsolutePathContext(false); | 20 AbsolutePathContext context = new AbsolutePathContext(false); |
24 | 21 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 expect(context.split(r'C:\path\to\foo'), [r'C:', r'path', r'to', r'foo']); | 132 expect(context.split(r'C:\path\to\foo'), [r'C:', r'path', r'to', r'foo']); |
136 expect(context.split(r'C:\path'), [r'C:', r'path']); | 133 expect(context.split(r'C:\path'), [r'C:', r'path']); |
137 } | 134 } |
138 | 135 |
139 void test_suffix() { | 136 void test_suffix() { |
140 expect( | 137 expect( |
141 context.suffix(r'C:\root\path', r'C:\root\path\a\b.dart'), r'a\b.dart'); | 138 context.suffix(r'C:\root\path', r'C:\root\path\a\b.dart'), r'a\b.dart'); |
142 expect(context.suffix(r'C:\root\path', r'C:\root\other.dart'), isNull); | 139 expect(context.suffix(r'C:\root\path', r'C:\root\other.dart'), isNull); |
143 } | 140 } |
144 } | 141 } |
OLD | NEW |