Index: pkg/analyzer/test/src/summary/incremental_cache_test.dart |
diff --git a/pkg/analyzer/test/src/summary/incremental_cache_test.dart b/pkg/analyzer/test/src/summary/incremental_cache_test.dart |
index 695cb51ac3e76f06ff0210ea8bfa6ccb6f9de2e6..3a8cfc5345d5d4ae55b5b961aa37e3d37a6b08d9 100644 |
--- a/pkg/analyzer/test/src/summary/incremental_cache_test.dart |
+++ b/pkg/analyzer/test/src/summary/incremental_cache_test.dart |
@@ -14,9 +14,57 @@ import '../abstract_single_unit.dart'; |
main() { |
groupSep = ' | '; |
+ runReflectiveTests(ComparePathsTest); |
runReflectiveTests(IncrementalCacheTest); |
} |
+@reflectiveTest |
+class ComparePathsTest extends AbstractSingleUnitTest { |
+ void test_empty() { |
+ expect(comparePaths('', ''), 0); |
+ } |
+ |
+ void test_equal() { |
+ expect(comparePaths('abc', 'abc'), 0); |
+ } |
+ |
+ void test_longer_suffixAfter() { |
+ expect(comparePaths('aab', 'aa'), 1); |
+ } |
+ |
+ void test_longer_suffixBefore() { |
+ expect(comparePaths('aaa', 'ab'), -1); |
+ } |
+ |
+ void test_longer_suffixSame() { |
+ expect(comparePaths('aaa', 'aa'), 1); |
+ } |
+ |
+ void test_sameLength_before0() { |
+ expect(comparePaths('aaa', 'bbb'), -1); |
+ } |
+ |
+ void test_sameLength_before1() { |
+ expect(comparePaths('aaa', 'bba'), -1); |
+ } |
+ |
+ void test_sameLength_before2() { |
+ expect(comparePaths('aaa', 'bba'), -1); |
+ } |
+ |
+ void test_shorter_suffixAfter() { |
+ expect(comparePaths('ab', 'aaa'), 1); |
+ } |
+ |
+ void test_shorter_suffixBefore() { |
+ expect(comparePaths('aa', 'aab'), -1); |
+ } |
+ |
+ void test_shorter_suffixSame() { |
+ expect(comparePaths('aa', 'aaa'), -1); |
+ } |
+} |
+ |
/** |
* TODO(scheglov) write more tests for invalidation. |
*/ |