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

Unified Diff: pkg/analyzer/test/src/dart/analysis/driver_test.dart

Issue 2519143002: Store index into AnalysisDriverResolvedUnit and return in AnalysisResult. (Closed)
Patch Set: Created 4 years, 1 month 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/analyzer/lib/src/summary/idl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698