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

Unified Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 1066913002: Tweaks for 'Encapsulate Field' assist. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/assist_test.dart
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index bdebc7fecb547762633585a0d5612883fcb4982f..a7d85348c07ed15d0dd719a20feecf0153ca3449 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -1342,6 +1342,15 @@ main(A a) {
assertNoAssistAt('_test =', AssistKind.ENCAPSULATE_FIELD);
}
+ void test_encapsulateField_BAD_final() {
+ resolveTestUnit('''
+class A {
+ final int test = 42;
+}
+''');
+ assertNoAssistAt('test =', AssistKind.ENCAPSULATE_FIELD);
+ }
+
void test_encapsulateField_BAD_multipleFields() {
resolveTestUnit('''
class A {
@@ -1354,6 +1363,15 @@ main(A a) {
assertNoAssistAt('bbb, ', AssistKind.ENCAPSULATE_FIELD);
}
+ void test_encapsulateField_BAD_notOnName() {
+ resolveTestUnit('''
+class A {
+ int test = 1 + 2 + 3;
+}
+''');
+ assertNoAssistAt('+ 2', AssistKind.ENCAPSULATE_FIELD);
+ }
+
void test_encapsulateField_BAD_parseError() {
verifyNoTestUnitErrors = false;
resolveTestUnit('''
@@ -1367,10 +1385,20 @@ main(A a) {
assertNoAssistAt('; // marker', AssistKind.ENCAPSULATE_FIELD);
}
+ void test_encapsulateField_BAD_static() {
+ resolveTestUnit('''
+class A {
+ static int test = 42;
+}
+''');
+ assertNoAssistAt('test =', AssistKind.ENCAPSULATE_FIELD);
+ }
+
void test_encapsulateField_OK_hasType() {
resolveTestUnit('''
class A {
int test = 42;
+ A(this.test);
}
main(A a) {
print(a.test);
@@ -1385,6 +1413,7 @@ class A {
void set test(int test) {
_test = test;
}
+ A(this._test);
}
main(A a) {
print(a.test);
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698