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

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/SyntaxTranslatorTest.java

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
11 * or implied. See the License for the specific language governing permissions a nd limitations under 11 * or implied. See the License for the specific language governing permissions a nd limitations under
12 * the License. 12 * the License.
13 */ 13 */
14 14
15 package com.google.dart.java2dart; 15 package com.google.dart.java2dart;
16 16
17 import com.google.common.base.Joiner; 17 import com.google.common.base.Joiner;
18 import com.google.common.collect.ImmutableMap; 18 import com.google.common.collect.ImmutableMap;
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 parseJava( 320 parseJava(
321 "// filler filler filler filler filler filler filler filler filler fille r", 321 "// filler filler filler filler filler filler filler filler filler fille r",
322 "public class A {", 322 "public class A {",
323 " void test() {", 323 " void test() {",
324 " String[] v = new String[3];", 324 " String[] v = new String[3];",
325 " }", 325 " }",
326 "}"); 326 "}");
327 assertDartSource(// 327 assertDartSource(//
328 "class A {", 328 "class A {",
329 " void test() {", 329 " void test() {",
330 " List<String> v = new List<String>.fixedLength(3);", 330 " List<String> v = new List<String>(3);",
331 " }", 331 " }",
332 "}"); 332 "}");
333 } 333 }
334 334
335 public void test_expressionArrayInitializer() throws Exception { 335 public void test_expressionArrayInitializer() throws Exception {
336 parseJava( 336 parseJava(
337 "// filler filler filler filler filler filler filler filler filler fille r", 337 "// filler filler filler filler filler filler filler filler filler fille r",
338 "public class A {", 338 "public class A {",
339 " void test() {", 339 " void test() {",
340 " int[] v = {1, 2, 3};", 340 " int[] v = {1, 2, 3};",
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1693 JavaCore.ENABLED)); 1693 JavaCore.ENABLED));
1694 parser.setSource(source.toCharArray()); 1694 parser.setSource(source.toCharArray());
1695 javaUnit = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null) ; 1695 javaUnit = (org.eclipse.jdt.core.dom.CompilationUnit) parser.createAST(null) ;
1696 assertThat(javaUnit.getProblems()).isEmpty(); 1696 assertThat(javaUnit.getProblems()).isEmpty();
1697 } 1697 }
1698 1698
1699 private void translate() { 1699 private void translate() {
1700 dartUnit = SyntaxTranslator.translate(context, javaUnit); 1700 dartUnit = SyntaxTranslator.translate(context, javaUnit);
1701 } 1701 }
1702 } 1702 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698