Index: pkg/analyzer/test/src/dart/analysis/driver_test.dart |
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart |
index e5777f5450526c0673eaa3c8530d87d57af72d11..f4ee85b3e9c1f81207097a0e46adb35590ee73c9 100644 |
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart |
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart |
@@ -19,6 +19,7 @@ import 'package:analyzer/src/dart/analysis/status.dart'; |
import 'package:analyzer/src/error/codes.dart'; |
import 'package:analyzer/src/generated/engine.dart' show AnalysisOptionsImpl; |
import 'package:analyzer/src/generated/source.dart'; |
+import 'package:analyzer/src/summary/idl.dart'; |
import 'package:convert/convert.dart'; |
import 'package:crypto/crypto.dart'; |
import 'package:test/test.dart'; |
@@ -437,6 +438,24 @@ main() { |
} |
} |
+ test_getResult_hasIndex() async { |
+ String content = r''' |
+foo(int p) {} |
+main() { |
+ foo(42); |
+} |
+'''; |
+ addTestFile(content); |
+ |
+ AnalysisResult result = await driver.getResult(testFile); |
+ |
+ AnalysisDriverUnitIndex index = result.index; |
+ int unitId = index.strings.indexOf('package:test/test.dart'); |
+ int fooId = index.strings.indexOf('foo'); |
+ expect(unitId, isNonNegative); |
+ expect(fooId, isNonNegative); |
+ } |
+ |
test_getResult_inferTypes_finalField() async { |
addTestFile( |
r''' |
@@ -1068,6 +1087,7 @@ var A = B; |
expect(result.contentHash, _md5(content)); |
expect(result.unit, isNull); |
expect(result.errors, hasLength(0)); |
+ expect(result.index, isNotNull); |
} |
test_results_status() async { |