Chromium Code Reviews| 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..053d5fae826c7cb033dc4502d9918118ab5cd772 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 set [x, constructorForD]. |
|
scheglov
2016/02/18 19:29:13
I don't understand this comment.
Brian Wilkerson
2016/02/18 19:36:38
Sorry, copy-paste error.
|
| + computeResult(annotation.elementAnnotation, CONSTANT_DEPENDENCIES, |
| + matcher: isComputeConstantDependenciesTask); |
| + expect(outputs[CONSTANT_DEPENDENCIES], hasLength(1)); |
| + } |
| + |
| test_annotation_without_args() { |
| Source source = newSource( |
| '/test.dart', |