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

Unified Diff: pkg/analysis_server/test/services/correction/diff_test.dart

Issue 615313004: Use simple prefix/suffix diff in members sorter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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_server/test/services/correction/diff_test.dart
diff --git a/pkg/analysis_server/test/services/correction/diff_test.dart b/pkg/analysis_server/test/services/correction/diff_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..76259391b2f17295dbb0964b1bf45ecfca3b547d
--- /dev/null
+++ b/pkg/analysis_server/test/services/correction/diff_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.
+
+library test.services.correction.diff;
+
+import 'package:analysis_server/src/services/correction/diff.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../reflective_tests.dart';
+
+
+main() {
+ groupSep = ' | ';
+ runReflectiveTests(DiffTest);
+}
+
+@ReflectiveTestCase()
+class DiffTest {
+ void test_findCommonPrefix() {
+ expect(findCommonPrefix('abc', 'xyz'), 0);
+ expect(findCommonPrefix('1234abcdef', '1234xyz'), 4);
+ expect(findCommonPrefix('123', '123xyz'), 3);
+ }
+
+ void test_findCommonSuffix() {
+ expect(findCommonSuffix('abc', 'xyz'), 0);
+ expect(findCommonSuffix('abcdef1234', 'xyz1234'), 4);
+ expect(findCommonSuffix('123', 'xyz123'), 3);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698