Index: dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java |
=================================================================== |
--- dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java (revision 29808) |
+++ dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java (working copy) |
@@ -192,6 +192,19 @@ |
assertTrue(isFunctionExpression("() => e")); |
} |
+ public void test_isFunctionExpression_parameter_final() throws Exception { |
+ assertTrue(isFunctionExpression("(final a) {}")); |
+ assertTrue(isFunctionExpression("(final a, b) {}")); |
+ assertTrue(isFunctionExpression("(final a, final b) {}")); |
+ } |
+ |
+ public void test_isFunctionExpression_parameter_final_typed() throws Exception { |
+ assertTrue(isFunctionExpression("(final int a) {}")); |
+ assertTrue(isFunctionExpression("(final prefix.List a) {}")); |
+ assertTrue(isFunctionExpression("(final List<int> a) {}")); |
+ assertTrue(isFunctionExpression("(final prefix.List<int> a) {}")); |
+ } |
+ |
public void test_isFunctionExpression_parameter_multiple() throws Exception { |
assertTrue(isFunctionExpression("(a, b) {}")); |
} |
@@ -930,6 +943,20 @@ |
assertNotNull(variable.getName()); |
} |
+ public void test_parseClassMember_field_namedOperator_withAssignment() throws Exception { |
+ FieldDeclaration field = parse("parseClassMember", new Object[] {"C"}, "var operator = (5);"); |
+ assertNull(field.getDocumentationComment()); |
+ assertSize(0, field.getMetadata()); |
+ assertNull(field.getStaticKeyword()); |
+ VariableDeclarationList list = field.getFields(); |
+ assertNotNull(list); |
+ NodeList<VariableDeclaration> variables = list.getVariables(); |
+ assertSize(1, variables); |
+ VariableDeclaration variable = variables.get(0); |
+ assertNotNull(variable.getName()); |
+ assertNotNull(variable.getInitializer()); |
+ } |
+ |
public void test_parseClassMember_field_namedSet() throws Exception { |
FieldDeclaration field = parse("parseClassMember", new Object[] {"C"}, "var set;"); |
assertNull(field.getDocumentationComment()); |