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

Unified Diff: pkg/analyzer/test/generated/compile_time_error_code_test.dart

Issue 881403002: Fix for issue 22052 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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/analyzer/test/generated/compile_time_error_code_test.dart
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 968adecfa16041082844375c00706be352a68b81..5df81b0bf003ee0c8d9644e48e5ef7777c6da79b 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -20,6 +20,32 @@ main() {
@reflectiveTest
class CompileTimeErrorCodeTest extends ResolverTestCase {
+ void fail_awaitInWrongContext_sync() {
+ // This test requires better error recovery than we currently have. In
+ // particular, we need to be able to distinguish between an await expression
+ // in the wrong context, and the use of 'await' as an identifier.
+ Source source = addSource(r'''
+f(x) {
+ return await x;
+}''');
+ resolve(source);
+ assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
+ verify([source]);
+ }
+
+ void fail_awaitInWrongContext_syncStar() {
+ // This test requires better error recovery than we currently have. In
+ // particular, we need to be able to distinguish between an await expression
+ // in the wrong context, and the use of 'await' as an identifier.
+ Source source = addSource(r'''
+f(x) sync* {
+ yield await x;
+}''');
+ resolve(source);
+ assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
+ verify([source]);
+ }
+
void fail_compileTimeConstantRaisesException() {
Source source = addSource(r'''
''');
@@ -231,26 +257,6 @@ f(list) {
verify([source]);
}
- void test_awaitInWrongContext_sync() {
- Source source = addSource(r'''
-f(x) {
- return await x;
-}''');
- resolve(source);
- assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
- verify([source]);
- }
-
- void test_awaitInWrongContext_syncStar() {
- Source source = addSource(r'''
-f(x) sync* {
- yield await x;
-}''');
- resolve(source);
- assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
- verify([source]);
- }
-
void test_builtInIdentifierAsMixinName_classTypeAlias() {
Source source = addSource(r'''
class A {}

Powered by Google App Engine
This is Rietveld 408576698