Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Unified Diff: tests/compiler/dart2js/mirror_helper_test.dart

Issue 21339002: Rename MirrorSystem.getName calls in dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
+*/

Powered by Google App Engine
This is Rietveld 408576698