Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: pkg/analysis_services/test/correction/levenshtein_test.dart

Issue 414273002: New 'use similar' fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_services/test/correction/levenshtein_test.dart
diff --git a/pkg/analysis_services/test/correction/levenshtein_test.dart b/pkg/analysis_services/test/correction/levenshtein_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3156858e6f3e40b92c2e46b04a8fcca98aa1d5b0
--- /dev/null
+++ b/pkg/analysis_services/test/correction/levenshtein_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This code was auto-generated, is not intended to be edited, and is subject to
+// significant change. Please see the README file for more information.
+
+library test.services.correction.levenshtein;
+
+import 'package:analysis_services/src/correction/levenshtein.dart';
+import 'package:unittest/unittest.dart';
+
+
+main() {
+ groupSep = ' | ';
+ test('getLevenshteinDistance', () {
+ expect(getLevenshteinDistance('test', 'test'), equals(0));
+ expect(getLevenshteinDistance('String', 'Stirng'), equals(2));
+ expect(getLevenshteinDistance('', ''), equals(0));
+ expect(getLevenshteinDistance('kitten', 'sitting'), equals(3));
+ expect(getLevenshteinDistance('Saturday', 'Sunday'), equals(3));
+ expect(
+ getLevenshteinDistance('Saturday', 'sunday', caseSensitive: false),
+ equals(3));
+ expect(
+ getLevenshteinDistance('SaturDay', 'sunday', caseSensitive: false),
+ equals(3));
+ expect(getLevenshteinDistance('', 'fewfe'), equals(5));
+ expect(getLevenshteinDistance('fewfe', ''), equals(5));
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698