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

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

Issue 664403002: Issue 21372. "Convert into block body" and "Convert into expression body" for factory constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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
« 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 d37d3e635eda96b82ef63508ce6e2491eaf25337..c6a64b40c366d7b619675988c810ab59f94ad5f7 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -442,6 +442,36 @@ fff() => 42;
''');
}
+ void test_convertToExpressionBody_OK_constructor() {
+ _indexTestUnit('''
+class A {
+ factory A() {
+ return null;
+ }
+}
+''');
+ assertHasAssistAt('A()', AssistKind.CONVERT_INTO_EXPRESSION_BODY, '''
+class A {
+ factory A() => null;
+}
+''');
+ }
+
+ void test_convertToBlockBody_OK_constructor() {
+ _indexTestUnit('''
+class A {
+ factory A() => null;
+}
+''');
+ assertHasAssistAt('A()', AssistKind.CONVERT_INTO_BLOCK_BODY, '''
+class A {
+ factory A() {
+ return null;
+ }
+}
+''');
+ }
+
void test_convertToExpressionBody_OK_method_onBlock() {
_indexTestUnit('''
class A {
« 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