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:unittest/unittest.dart' hide isEmpty; | 8 import 'package:unittest/unittest.dart' hide isEmpty; |
9 | 9 |
10 import '../../reflective_tests.dart'; | 10 import '../../reflective_tests.dart'; |
11 | 11 |
12 | 12 |
13 | 13 |
14 main() { | 14 main() { |
15 groupSep = ' | '; | 15 groupSep = ' | '; |
16 runReflectiveTests(StringsTest); | 16 runReflectiveTests(StringsTest); |
17 } | 17 } |
18 | 18 |
19 | 19 |
20 @ReflectiveTestCase() | 20 @reflectiveTest |
21 class StringsTest { | 21 class StringsTest { |
22 void test_capitalize() { | 22 void test_capitalize() { |
23 expect(capitalize(''), ''); | 23 expect(capitalize(''), ''); |
24 expect(capitalize('a'), 'A'); | 24 expect(capitalize('a'), 'A'); |
25 expect(capitalize('abc'), 'Abc'); | 25 expect(capitalize('abc'), 'Abc'); |
26 expect(capitalize('abc def'), 'Abc def'); | 26 expect(capitalize('abc def'), 'Abc def'); |
27 expect(capitalize('ABC'), 'ABC'); | 27 expect(capitalize('ABC'), 'ABC'); |
28 } | 28 } |
29 | 29 |
30 void test_compareStrings() { | 30 void test_compareStrings() { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 expect(repeat('abc', 3), 'abcabcabc'); | 173 expect(repeat('abc', 3), 'abcabcabc'); |
174 } | 174 } |
175 | 175 |
176 void test_substringAfterLast() { | 176 void test_substringAfterLast() { |
177 expect(substringAfterLast('', '/'), ''); | 177 expect(substringAfterLast('', '/'), ''); |
178 expect(substringAfterLast('abc', ''), ''); | 178 expect(substringAfterLast('abc', ''), ''); |
179 expect(substringAfterLast('abc', 'd'), 'abc'); | 179 expect(substringAfterLast('abc', 'd'), 'abc'); |
180 expect(substringAfterLast('abcbde', 'b'), 'de'); | 180 expect(substringAfterLast('abcbde', 'b'), 'de'); |
181 } | 181 } |
182 } | 182 } |
OLD | NEW |