| Index: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/TypeSemanticProcessorTest.java
|
| diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/MathSemanticProcessorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/TypeSemanticProcessorTest.java
|
| similarity index 58%
|
| copy from editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/MathSemanticProcessorTest.java
|
| copy to editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/TypeSemanticProcessorTest.java
|
| index 771fe3d6ded983b5b41babe535e9854f3099a814..77bafe778ebd7ef578262453af640312e4747092 100644
|
| --- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/MathSemanticProcessorTest.java
|
| +++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/TypeSemanticProcessorTest.java
|
| @@ -14,38 +14,31 @@
|
| package com.google.dart.java2dart.processor;
|
|
|
| /**
|
| - * Test for {@link MathSemanticProcessor}.
|
| + * Test for {@link TypeSemanticProcessor}.
|
| */
|
| -public class MathSemanticProcessorTest extends SemanticProcessorTest {
|
| - public void test_abs() throws Exception {
|
| +public class TypeSemanticProcessorTest extends SemanticProcessorTest {
|
| + public void test_enumAssign() throws Exception {
|
| + setFileLines("test/MyIntf.java", "package test; public class MyIntf {}");
|
| + setFileLines("test/A.java", "package test; public class A implements Enum<A>, MyIntf {}");
|
| + setFileLines("test/B.java", "package test; public class B implements Enum<B>, MyIntf {}");
|
| translateSingleFile(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
| "package test;",
|
| "public class Test {",
|
| - " int asbInt(int p) {",
|
| - " return Math.abs(p);",
|
| - " }",
|
| - " int asbLong(long p) {",
|
| - " return Math.abs(p);",
|
| - " }",
|
| - " int asbFloat(float p) {",
|
| - " return Math.abs(p);",
|
| - " }",
|
| - " int asbDouble(double p) {",
|
| - " return Math.abs(p);",
|
| + " void main(boolean z, A a, B b) {",
|
| + " MyIntf res = z ? a : b;",
|
| " }",
|
| "}");
|
| runProcessor();
|
| assertFormattedSource(
|
| "class Test {",
|
| - " int asbInt(int p) => p.abs();",
|
| - " int asbLong(int p) => p.abs();",
|
| - " int asbFloat(double p) => p.abs();",
|
| - " int asbDouble(double p) => p.abs();",
|
| + " void main(bool z, A a, B b) {",
|
| + " MyIntf res = (z ? a : b) as MyIntf;",
|
| + " }",
|
| "}");
|
| }
|
|
|
| private void runProcessor() {
|
| - new MathSemanticProcessor(context).process(unit);
|
| + new TypeSemanticProcessor(context).process(unit);
|
| }
|
| }
|
|
|