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

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

Issue 2658983004: Implement AnalysisDriver.getSourceKind() and use it in analyzer-cli. (Closed)
Patch Set: Created 3 years, 11 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/analyzer/lib/src/dart/analysis/driver.dart ('k') | pkg/analyzer_cli/lib/src/analyzer_impl.dart » ('j') | 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 682adeacf0338acd963da732aead5ec1b2037093..1010176270fb49f29dc820bff0f661c5cc3e6dbd 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -1117,6 +1117,24 @@ var A2 = B1;
expect(result1.unit, isNotNull);
}
+ test_getSourceKind_library() async {
+ var path = _p('/test/lib/test.dart');
+ provider.newFile(path, 'class A {}');
+ expect(await driver.getSourceKind(path), SourceKind.LIBRARY);
+ }
+
+ test_getSourceKind_notDartFile() async {
+ var path = _p('/test/lib/test.txt');
+ provider.newFile(path, 'class A {}');
+ expect(await driver.getSourceKind(path), isNull);
+ }
+
+ test_getSourceKind_part() async {
+ var path = _p('/test/lib/test.dart');
+ provider.newFile(path, 'part of lib; class A {}');
+ expect(await driver.getSourceKind(path), SourceKind.PART);
+ }
+
test_getTopLevelNameDeclarations() async {
var a = _p('/test/lib/a.dart');
var b = _p('/test/lib/b.dart');
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/driver.dart ('k') | pkg/analyzer_cli/lib/src/analyzer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698