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

Unified Diff: pkg/analyzer/test/src/summary/package_bundle_reader_test.dart

Issue 2225893003: Provide LINE_INFO from ResynthesizerResultProvider. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/analyzer/test/src/summary/package_bundle_reader_test.dart
diff --git a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
index e446d19ae0570b07e40e502c2d385c82474e38ac..bc72c203d031e4cc8a51a050512d5f82491d604b 100644
--- a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
+++ b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
@@ -10,6 +10,7 @@ import 'package:analyzer/src/summary/package_bundle_reader.dart';
import 'package:analyzer/src/task/dart.dart';
import 'package:analyzer/src/util/fast_uri.dart';
import 'package:analyzer/task/dart.dart';
+import 'package:analyzer/task/general.dart';
import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
@@ -92,6 +93,19 @@ class ResynthesizerResultProviderTest {
expect(entry2.getValue(CONTAINING_LIBRARIES), unorderedEquals([source1]));
}
+ test_compute_LINE_INFO_hasLineStarts() {
+ when(unlinkedUnit1.lineStarts).thenReturn(<int>[10, 20, 30]);
+ bool success = provider.compute(entry1, LINE_INFO);
+ expect(success, isTrue);
+ expect(entry1.getValue(LINE_INFO).lineStarts, <int>[10, 20, 30]);
+ }
+
+ test_compute_LINE_INFO_emptyLineStarts() {
+ when(unlinkedUnit1.lineStarts).thenReturn(<int>[]);
+ bool success = provider.compute(entry1, LINE_INFO);
+ expect(success, isFalse);
+ }
+
test_compute_SOURCE_KIND_librarySource() {
bool success = provider.compute(entry1, SOURCE_KIND);
expect(success, isTrue);
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698