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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DynamicTypesFinderTest.java

Issue 11305007: Getter with parameters is error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DynamicTypesFinderTest.java
diff --git a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DynamicTypesFinderTest.java b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DynamicTypesFinderTest.java
index 47930d66511f603a9e13f1b6114a691b6e83a334..fc7cd2f8c53dc7d1b84524717bae7c368a431e78 100644
--- a/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DynamicTypesFinderTest.java
+++ b/editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/utilities/ast/DynamicTypesFinderTest.java
@@ -13,6 +13,11 @@
*/
package com.google.dart.tools.core.utilities.ast;
+import java.util.Collection;
+import java.util.List;
+
+import junit.framework.TestCase;
+
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.dart.compiler.DartCompilationError;
@@ -23,48 +28,11 @@ import com.google.dart.tools.core.model.CompilationUnit;
import com.google.dart.tools.core.test.util.TestProject;
import com.google.dart.tools.core.utilities.compiler.DartCompilerUtilities;
-import junit.framework.TestCase;
-
-import java.util.Collection;
-import java.util.List;
-
/**
* Test for {@link DynamicTypesFinder}.
*/
public class DynamicTypesFinderTest extends TestCase {
- public void testGetterSetter() throws Exception {
- assertMatches(
- join(
- "class Foo {",
- " String _foo;",
- " String get !1fooBar() => _foo == null ? 'none' : _foo;",
- " set !2fooBar(String foo) => _foo = foo;",
- "}"),
- "1-fooBar",
- "2-fooBar");
- }
-
- public void testLocals() throws Exception {
- assertMatches(
- join(
- "class Foo {",
- " main() {",
- " new Foo().foo();",
- " }",
- " void foo(){",
- " var !1x;",
- //" !2x = 3;",
- " int !3y = 3;",
- " var !4z = 'foo';",
- " }",
- "}"),
- "1+x",
- //"2+x",
- "3-y",
- "4-z");
- }
-
/**
* Assert that the given source has the expected matches (indicating refinable types).
*
@@ -108,6 +76,38 @@ public class DynamicTypesFinderTest extends TestCase {
return src.replaceAll("![\\d]", "");
}
+ public void testGetterSetter() throws Exception {
+ assertMatches(
+ join(
+ "class Foo {",
+ " String _foo;",
+ " String get !1fooBar => _foo == null ? 'none' : _foo;",
+ " set !2fooBar(String foo) => _foo = foo;",
+ "}"),
+ "1-fooBar",
+ "2-fooBar");
+ }
+
+ public void testLocals() throws Exception {
+ assertMatches(
+ join(
+ "class Foo {",
+ " main() {",
+ " new Foo().foo();",
+ " }",
+ " void foo(){",
+ " var !1x;",
+ //" !2x = 3;",
+ " int !3y = 3;",
+ " var !4z = 'foo';",
+ " }",
+ "}"),
+ "1+x",
+ //"2+x",
+ "3-y",
+ "4-z");
+ }
+
private void verifyLocations(LocationSpec test, Iterable<DartIdentifier> matches) {
for (String result : test.positiveResults) {
// verify that result is present in matches

Powered by Google App Engine
This is Rietveld 408576698