Chromium Code Reviews| Index: tests/compiler/dart2js/parser_test.dart |
| diff --git a/tests/compiler/dart2js/parser_test.dart b/tests/compiler/dart2js/parser_test.dart |
| index d68d23f039ea39f47f99b4a96e7c11b2dd7a1da0..393d8207feb548134f022f6967ddee65af419c53 100644 |
| --- a/tests/compiler/dart2js/parser_test.dart |
| +++ b/tests/compiler/dart2js/parser_test.dart |
| @@ -254,6 +254,18 @@ void testPostfix() { |
| Expect.isTrue(sendSet.arguments.isEmpty()); |
| } |
| +void testOperatorParse() { |
| + FunctionDeclaration node = parseStatement('operator negate() => null;'); |
| + FunctionExpression expr = node.function; |
|
ahe
2012/08/06 10:35:38
Look at the rest of this file. We don't abbreviate
Anton Muhin
2012/08/06 11:36:18
Done.
|
| + Node name = expr.name; |
| + Expect.isTrue(name is Send); |
|
ahe
2012/08/06 10:35:38
See the above code in testPostfix. This should be:
Anton Muhin
2012/08/06 11:36:18
Done.
|
| + Expect.equals(name.receiver.source.stringValue, 'operator'); |
|
ahe
2012/08/06 10:35:38
Use stringEquals and put the expected value first.
Anton Muhin
2012/08/06 11:36:18
Done.
|
| + Expect.equals(name.selector.source.stringValue, 'negate'); |
|
ahe
2012/08/06 10:35:38
Ditto.
Anton Muhin
2012/08/06 11:36:19
Done.
|
| + Expect.isTrue(expr.parameters.isEmpty()); |
| + Expect.isNull(expr.returnType); |
| + Expect.isNull(expr.getOrSet); |
| +} |
| + |
| void main() { |
| testGenericTypes(); |
| // TODO(ahe): Enable this test when we handle library prefixes. |
| @@ -267,4 +279,5 @@ void main() { |
| testAssignment(); |
| testIndex(); |
| testPostfix(); |
| + testOperatorParse(); |
| } |