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.levenshtein; | 5 library test.services.correction.levenshtein; |
6 | 6 |
7 import 'package:analysis_server/src/services/correction/levenshtein.dart'; | 7 import 'package:analysis_server/src/services/correction/levenshtein.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(LevenshteinTest); | 13 defineReflectiveTests(LevenshteinTest); |
17 }); | 14 }); |
18 } | 15 } |
19 | 16 |
20 @reflectiveTest | 17 @reflectiveTest |
21 class LevenshteinTest { | 18 class LevenshteinTest { |
22 void test_different_caseInsensitive() { | 19 void test_different_caseInsensitive() { |
23 expect(levenshtein('Saturday', 'sunday', 5, caseSensitive: false), 3); | 20 expect(levenshtein('Saturday', 'sunday', 5, caseSensitive: false), 3); |
24 expect(levenshtein('SaturDay', 'sunday', 5, caseSensitive: false), 3); | 21 expect(levenshtein('SaturDay', 'sunday', 5, caseSensitive: false), 3); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 59 |
63 void test_same() { | 60 void test_same() { |
64 expect(levenshtein('', '', 5), 0); | 61 expect(levenshtein('', '', 5), 0); |
65 expect(levenshtein('test', 'test', 5), 0); | 62 expect(levenshtein('test', 'test', 5), 0); |
66 } | 63 } |
67 | 64 |
68 void test_same_caseInsensitive() { | 65 void test_same_caseInsensitive() { |
69 expect(levenshtein('test', 'Test', 5, caseSensitive: false), 0); | 66 expect(levenshtein('test', 'Test', 5, caseSensitive: false), 0); |
70 } | 67 } |
71 } | 68 } |
OLD | NEW |