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

Unified Diff: compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java

Issue 9295019: DartToSourceVisitor was omitting type annotations on list/map literals (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 | « compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java b/compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java
index 00915769bd591fc791ccb73548f712ab63ef1baa..549e0f13d2f3a35ec54146a6c656d93e1e3af407 100644
--- a/compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java
+++ b/compiler/javatests/com/google/dart/compiler/ast/DartToSourceVisitorTest.java
@@ -1,9 +1,10 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, 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.
package com.google.dart.compiler.ast;
+import com.google.common.base.Joiner;
import com.google.dart.compiler.CompilerTestCase;
/**
@@ -76,6 +77,28 @@ public class DartToSourceVisitorTest extends CompilerTestCase {
"\n");
}
+ public void testArrayLiteral() {
+ same(Joiner.on("\n").join(
+ "// unit testcode",
+ "var m = [1, 2, 3];",
+ ""));
+ same(Joiner.on("\n").join(
+ "// unit testcode",
+ "var m = <int>[1, 2, 3];",
+ ""));
+ }
+
+ public void testMapLiteral() {
+ same(Joiner.on("\n").join(
+ "// unit testcode",
+ "var m = {\"a\" : 1, \"b\" : 2, \"c\" : 3};",
+ ""));
+ same(Joiner.on("\n").join(
+ "// unit testcode",
+ "var m = <int>{\"a\" : 1, \"b\" : 2, \"c\" : 3};",
+ ""));
+ }
+
private void same(String sourceCode) {
DartUnit unit = parseUnit("testcode", sourceCode);
String result = unit.toSource();
« no previous file with comments | « compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698