Chromium Code Reviews| Index: pkg/analysis_server/test/computer/element_test.dart |
| diff --git a/pkg/analysis_server/test/computer/element_test.dart b/pkg/analysis_server/test/computer/element_test.dart |
| index 5539c22eb3134aa68ba4e04c9fb8e20da477ef43..d8765b3fade73eba7ded7919420dd5cf90cda142 100644 |
| --- a/pkg/analysis_server/test/computer/element_test.dart |
| +++ b/pkg/analysis_server/test/computer/element_test.dart |
| @@ -283,6 +283,32 @@ class A { |
| expect(element.flags, Element.FLAG_STATIC); |
| } |
| + void test_fromElement_SETTER() { |
| + Source source = addSource('/test.dart', ''' |
| +class A { |
| + set mySetter(String x) {} |
| +}'''); |
| + CompilationUnit unit = resolveLibraryUnit(source); |
| + engine.FieldElement engineFieldElement = |
| + findElementInUnit(unit, 'mySetter', engine.ElementKind.FIELD); |
|
Brian Wilkerson
2014/09/16 22:47:46
The "engine.ElementKind.FIELD" argument looks stra
danrubel
2014/09/16 23:12:30
I was surprised as well, but my current understand
|
| + engine.PropertyAccessorElement engineElement = engineFieldElement.setter; |
| + // create notification Element |
| + Element element = new Element.fromEngine(engineElement); |
| + expect(element.kind, ElementKind.SETTER); |
| + expect(element.name, 'mySetter'); |
| + { |
| + Location location = element.location; |
| + expect(location.file, '/test.dart'); |
| + expect(location.offset, 16); |
| + expect(location.length, 'mySetter'.length); |
| + expect(location.startLine, 2); |
| + expect(location.startColumn, 7); |
| + } |
| + expect(element.parameters, '(String x)'); |
| + expect(element.returnType, isNull); |
| + expect(element.flags, 0); |
| + } |
| + |
| void test_fromElement_dynamic() { |
| var engineElement = engine.DynamicElementImpl.instance; |
| // create notification Element |