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

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

Issue 10583016: Add a test for operator[] unparse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next iteration Created 8 years, 6 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
« no previous file with comments | « lib/compiler/implementation/tree/unparser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..225161661e4c2a9dbb33a2de964d442889e5cd08 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_test.dart
@@ -5,11 +5,19 @@
#import('parser_helper.dart');
#import("../../../lib/compiler/implementation/tree/tree.dart");
+Node parseMember(String text) =>
ahe 2012/06/19 18:07:09 Considered moving this to parser_helper.dart?
Anton Muhin 2012/06/19 18:09:12 Done.
+ parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens));
+
testUnparse(String statement) {
Node node = parseStatement(statement);
Expect.equals(statement, node.unparse());
}
+testUnparseMember(String member) {
+ Node node = parseMember(member);
+ Expect.equals(member, node.unparse());
+}
+
testGenericTypes() {
testUnparse('var x=new List<List<int>>();');
testUnparse('var x=new List<List<List<int>>>();');
@@ -26,8 +34,13 @@ testEmptyList() {
testUnparse('var x= [];');
}
+testIndexedOperatorDecl() {
+ testUnparseMember('operator[](int i)=> null;');
+}
+
main() {
testGenericTypes();
testForLoop();
testEmptyList();
+ testIndexedOperatorDecl();
}
« no previous file with comments | « lib/compiler/implementation/tree/unparser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698