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

Unified Diff: editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/TypeSemanticProcessorTest.java

Issue 22285004: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698