OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.services.correction.strings; | 5 library test.services.correction.strings; |
6 | 6 |
7 import 'package:analysis_server/src/services/correction/strings.dart'; | 7 import 'package:analysis_server/src/services/correction/strings.dart'; |
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 8 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 import 'package:unittest/unittest.dart' hide isEmpty; | 9 import 'package:unittest/unittest.dart' hide isEmpty; |
10 | 10 |
| 11 import '../../utils.dart'; |
| 12 |
11 main() { | 13 main() { |
12 groupSep = ' | '; | 14 initializeTestEnvironment(); |
13 defineReflectiveTests(StringsTest); | 15 defineReflectiveTests(StringsTest); |
14 } | 16 } |
15 | 17 |
16 @reflectiveTest | 18 @reflectiveTest |
17 class StringsTest { | 19 class StringsTest { |
18 void test_capitalize() { | 20 void test_capitalize() { |
19 expect(capitalize(''), ''); | 21 expect(capitalize(''), ''); |
20 expect(capitalize('a'), 'A'); | 22 expect(capitalize('a'), 'A'); |
21 expect(capitalize('abc'), 'Abc'); | 23 expect(capitalize('abc'), 'Abc'); |
22 expect(capitalize('abc def'), 'Abc def'); | 24 expect(capitalize('abc def'), 'Abc def'); |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 expect(repeat('abc', 3), 'abcabcabc'); | 171 expect(repeat('abc', 3), 'abcabcabc'); |
170 } | 172 } |
171 | 173 |
172 void test_substringAfterLast() { | 174 void test_substringAfterLast() { |
173 expect(substringAfterLast('', '/'), ''); | 175 expect(substringAfterLast('', '/'), ''); |
174 expect(substringAfterLast('abc', ''), ''); | 176 expect(substringAfterLast('abc', ''), ''); |
175 expect(substringAfterLast('abc', 'd'), 'abc'); | 177 expect(substringAfterLast('abc', 'd'), 'abc'); |
176 expect(substringAfterLast('abcbde', 'b'), 'de'); | 178 expect(substringAfterLast('abcbde', 'b'), 'de'); |
177 } | 179 } |
178 } | 180 } |
OLD | NEW |