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

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

Issue 17317002: Convert isX() methods to isX getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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/PropertySemanticProcessorTest.java
diff --git a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
index dce56261b559657d3bb648a4ade585e66a8d9dc6..46fa2a1f48d45870301f5b43e377d9d35152b0e0 100644
--- a/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
+++ b/editor/util/plugins/com.google.dart.java2dart_test/src/com/google/dart/java2dart/processor/PropertySemanticProcessorTest.java
@@ -17,7 +17,7 @@ package com.google.dart.java2dart.processor;
* Test for {@link PropertySemanticProcessor}.
*/
public class PropertySemanticProcessorTest extends SemanticProcessorTest {
- public void test_makeProperty() throws Exception {
+ public void test_makeProperty_getSet() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",
"package test;",
@@ -53,6 +53,42 @@ public class PropertySemanticProcessorTest extends SemanticProcessorTest {
"}");
}
+ public void test_makeProperty_isSet() throws Exception {
+ translateSingleFile(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "package test;",
+ "public class Test {",
+ " private boolean foo;",
+ " public boolean isFoo() {",
+ " return foo;",
+ " }",
+ " public void setFoo(boolean v) {",
+ " this.foo = v;",
+ " }",
+ " public void main() {",
+ " setFoo(true);",
+ " print(isFoo());",
+ " this.setFoo(false);",
+ " print(this.isFoo());",
+ " }",
+ "}");
+ runProcessor();
+ assertFormattedSource(
+ "class Test {",
+ " bool _foo = false;",
+ " bool get isFoo => _foo;",
+ " void set foo(bool v) {",
+ " this._foo = v;",
+ " }",
+ " void main() {",
+ " foo = true;",
+ " print(isFoo);",
+ " this.foo = false;",
+ " print(this.isFoo);",
+ " }",
+ "}");
+ }
+
public void test_makeProperty_override() throws Exception {
translateSingleFile(
"// filler filler filler filler filler filler filler filler filler filler",

Powered by Google App Engine
This is Rietveld 408576698