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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1711053002: Add test for already fixed bug (issue 25730) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 8df7837761dbc8c2d45e098050900d515f32fbf0..9215145dae8e44e23ab4766f1f23d3376ee616a5 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -1145,6 +1145,33 @@ class D { const D(value); }
outputs[CONSTANT_DEPENDENCIES].toSet(), [x, constructorForD].toSet());
}
+ test_annotation_with_nonConstArg() {
+ Source source = newSource(
+ '/test.dart',
+ '''
+class A {
+ const A(x);
+}
+class C {
+ @A(const [(_) => null])
+ String s;
+}
+''');
+ // First compute the resolved unit for the source.
+ LibrarySpecificUnit librarySpecificUnit =
+ new LibrarySpecificUnit(source, source);
+ computeResult(librarySpecificUnit, RESOLVED_UNIT1);
+ CompilationUnit unit = outputs[RESOLVED_UNIT1];
+ // Find the annotation on the field.
+ ClassDeclaration classC = unit.declarations[1];
+ Annotation annotation = classC.members[0].metadata[0];
+ // Now compute the dependencies for the annotation, and check that it is
+ // the right size.
+ computeResult(annotation.elementAnnotation, CONSTANT_DEPENDENCIES,
+ matcher: isComputeConstantDependenciesTask);
+ expect(outputs[CONSTANT_DEPENDENCIES], hasLength(1));
+ }
+
test_annotation_without_args() {
Source source = newSource(
'/test.dart',
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698