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

Unified Diff: pkg/analysis_services/test/index/store/codec_test.dart

Issue 399723003: Improve Dart master index selectivity. (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
« no previous file with comments | « pkg/analysis_services/lib/src/index/store/split_store.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_services/test/index/store/codec_test.dart
diff --git a/pkg/analysis_services/test/index/store/codec_test.dart b/pkg/analysis_services/test/index/store/codec_test.dart
index c72cb6054186b34054e8cda7ca13017fcbf52546..6664b90cd7c9dd41fd3693fe6b34a0456335efff 100644
--- a/pkg/analysis_services/test/index/store/codec_test.dart
+++ b/pkg/analysis_services/test/index/store/codec_test.dart
@@ -105,6 +105,30 @@ class A {
}
}
+ void test_encodeHash_notLocal() {
+ resolveTestUnit('''
+class A {
+ void mainA() {
+ int foo; // A
+ }
+ void mainB() {
+ int foo; // B
+ int bar;
+ }
+}
+''');
+ MethodElement mainA = findElement('mainA');
+ MethodElement mainB = findElement('mainB');
+ Element fooA = mainA.localVariables[0];
+ Element fooB = mainB.localVariables[0];
+ Element bar = mainB.localVariables[1];
+ int id_fooA = codec.encodeHash(fooA);
+ int id_fooB = codec.encodeHash(fooB);
+ int id_bar = codec.encodeHash(bar);
+ expect(id_fooA == id_fooB, isTrue);
+ expect(id_fooA == id_bar, isFalse);
+ }
+
void test_localLocalVariable() {
resolveTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_services/lib/src/index/store/split_store.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698