Chromium Code Reviews| Index: tests/compiler/dart2js/mirror_helper_test.dart |
| diff --git a/tests/compiler/dart2js/mirror_helper_test.dart b/tests/compiler/dart2js/mirror_helper_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7d7034f0ef96fc682c8072b2fbd68b70b636423f |
| --- /dev/null |
| +++ b/tests/compiler/dart2js/mirror_helper_test.dart |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// 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 "package:expect/expect.dart"; |
| + |
| +main() { |
| + |
| +} |
| + |
| + |
| + |
| +/* |
| + |
| +IDEAS FOR TESTING RENAMING OF MIRROR CALLS |
| + |
| +1) Rough skeleton: |
| + |
| +Map<Element, ElementAst> elementAsts = partiallyCompile(<source>); (How can we do this?) |
| + |
| +Assert elementAsts is as expected |
|
ahe
2013/07/31 13:16:28
Precisely what do you mean by "expected"?
zarah
2013/08/02 07:53:41
Added tests.
|
| + |
| +Map<Node, String> renames = new ... |
| + |
| +Map<LibraryElement, String> imports = new .. |
| + |
| +MirrorCollector collector = new MirrorCollector(renames, imports, compiler, elementAsts); |
| + |
| +for(Element e in elementAsts.keys) { |
| + collector.collect(e); |
| +} |
| +Assert renames and imports have appropriate entries. |
| + |
| + |
| +Do the above with sources affecting all paths in mirrorCollector |
| + |
| +2) If the above not possible maybe manually construct the parts needed by mirrorCollector, |
| + and call its methods directly. |
| + |
| +3) Later tests should test that the actual MirrorHelper library is called, |
| + which should be doable by writing small test programs, compiling and running them. |
| + |
| +4) Even later, the MirrorHelper library should also be testet on its own with |
| + hand-written sample programs as they would come out of compiling. |
| +*/ |