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

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

Issue 1324323004: Issue 24298. Fix for 'async' function body conversion. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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: 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 4d20cc0c39efdc5e8717094060cca851ecd5836c..9a256a29bf92bf7ea0fc7c3f9499691ccd2394c8 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -823,6 +823,24 @@ void f() {}
assertNoAssistAt('f();', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
}
+ void test_convertToBlockBody_OK_async() {
+ resolveTestUnit('''
+class A {
+ mmm() async => 123;
+}
+''');
+ assertHasAssistAt(
+ 'mmm()',
+ DartAssistKind.CONVERT_INTO_BLOCK_BODY,
+ '''
+class A {
+ mmm() async {
+ return 123;
+ }
+}
+''');
+ }
+
void test_convertToBlockBody_OK_closure() {
resolveTestUnit('''
setup(x) {}
@@ -955,6 +973,24 @@ fff() {
assertNoAssistAt('fff() {', DartAssistKind.CONVERT_INTO_BLOCK_BODY);
}
+ void test_convertToExpressionBody_OK_async() {
+ resolveTestUnit('''
+class A {
+ mmm() async {
+ return 42;
+ }
+}
+''');
+ assertHasAssistAt(
+ 'mmm',
+ DartAssistKind.CONVERT_INTO_EXPRESSION_BODY,
+ '''
+class A {
+ mmm() async => 42;
+}
+''');
+ }
+
void test_convertToExpressionBody_OK_closure() {
resolveTestUnit('''
setup(x) {}

Powered by Google App Engine
This is Rietveld 408576698