Chromium Code Reviews| Index: tests/compiler/dart2js/unparser_test.dart |
| diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart |
| index fb770fb9b3e78a51df186022d6f055bd73054a5c..eb2d679d113da4769284110266843714fba8534a 100644 |
| --- a/tests/compiler/dart2js/unparser_test.dart |
| +++ b/tests/compiler/dart2js/unparser_test.dart |
| @@ -2,7 +2,9 @@ |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| +#import('mock_compiler.dart'); |
| #import('parser_helper.dart'); |
| +#import("../../../lib/compiler/implementation/elements/elements.dart"); |
| #import("../../../lib/compiler/implementation/tree/tree.dart"); |
| testUnparse(String statement) { |
| @@ -26,8 +28,20 @@ testEmptyList() { |
| testUnparse('var x= [];'); |
| } |
| +testIndexedOperatorDecl() { |
| + MockCompiler compiler = new MockCompiler(); |
|
ahe
2012/06/19 16:42:45
Could you use this instead:
Node parseMember(Stri
Anton Muhin
2012/06/19 18:02:05
Neat, thanks, done (almost veni, vidi, vici :)
On
|
| + var elements = parseUnit( |
| + 'class A { operator[](int i) => null; }', |
| + compiler, compiler.mainApp); |
| + ClassElement cls = elements.head.ensureResolved(compiler); |
| + FunctionElement func = cls.members.head; |
| + Node node = func.parseNode(compiler); |
| + Expect.equals('operator[](int i)=> null;', '${node}'); |
| +} |
| + |
| main() { |
| testGenericTypes(); |
| testForLoop(); |
| testEmptyList(); |
| + testIndexedOperatorDecl(); |
| } |