| 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();
|
|
|