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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_method_test.dart

Issue 971203002: Don't allow to extract a closure as a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/refactoring/extract_method.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/refactoring/extract_method_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index a092f1e78a71491d9d4b8a217d4fe756e7b7c76d..45abe94d47b49dda6fbaa9a5643ce12b04a3141e 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -623,6 +623,20 @@ main() {
"Operation not applicable to a while statement's expression and body.");
}
+ test_canExtractGetter_false_closure() async {
+ indexTestUnit('''
+main() {
+ useFunction((_) => true);
+}
+useFunction(filter(String p)) {}
+''');
+ _createRefactoringForString('(_) => true');
+ // apply refactoring
+ await assertRefactoringConditionsOK();
+ expect(refactoring.canCreateGetter, false);
+ expect(refactoring.createGetter, false);
+ }
+
test_canExtractGetter_false_fieldAssignment() async {
indexTestUnit('''
class A {
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/extract_method.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698