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

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

Issue 2010283002: Add YieldStatement support to ExitDetector (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/all_the_rest_test.dart
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index c4a47ca220bc487a37d30fd9e45132b192785e64..3594bfbb5972891ffcaefa716b592d85b633a6fc 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -3962,6 +3962,42 @@ void f() {
_assertNthStatementExits(source, 0);
}
+ void test_yieldStatement_plain() {
+ Source source = addSource(r'''
+void f() sync* {
+ yield 1;
+}
+''');
+ _assertNthStatementDoesNotExit(source, 0);
+ }
+
+ void test_yieldStatement_throw() {
+ Source source = addSource(r'''
+void f() sync* {
+ yield throw '';
+}
+''');
+ _assertNthStatementExits(source, 0);
+ }
+
+ void test_yieldStatement_star_plain() {
+ Source source = addSource(r'''
+void f() sync* {
+ yield* 1;
+}
+''');
+ _assertNthStatementDoesNotExit(source, 0);
+ }
+
+ void test_yieldStatement_star_throw() {
+ Source source = addSource(r'''
+void f() sync* {
+ yield* throw '';
+}
+''');
+ _assertNthStatementExits(source, 0);
+ }
+
void _assertHasReturn(bool expectedResult, Source source, int n) {
LibraryElement element = resolve2(source);
CompilationUnit unit = resolveCompilationUnit(source, element);
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698