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 fcf09dee47dbea8966b6d5a44f4c9f13fd799970..55d87ee6748237bf3555ff8a9443ce8d876bda75 100644 |
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart |
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart |
@@ -3479,14 +3479,14 @@ class ExitDetectorTest extends ParserTestCase { |
expect(new ExitDetector(), isNotNull); |
} |
- void test_doStatement_throwCondition() { |
- _assertTrue("{ do {} while (throw ''); }"); |
- } |
- |
void test_doStatement_return() { |
_assertTrue("{ do { return null; } while (1 == 2); }"); |
} |
+ void test_doStatement_throwCondition() { |
+ _assertTrue("{ do {} while (throw ''); }"); |
+ } |
+ |
void test_doStatement_true_break() { |
_assertFalse("{ do { break; } while (true); }"); |
} |
@@ -3787,8 +3787,40 @@ class ExitDetectorTest extends ParserTestCase { |
_assertTrue("try {} catch (e, s) {} finally { return 1; }"); |
} |
- void test_tryStatement_return_try() { |
- _assertTrue("try { return 1; } catch (e, s) {} finally {}"); |
+ void test_tryStatement_return_try_noCatch() { |
Brian Wilkerson
2016/06/11 00:13:39
Strangely enough, all of the tests use a try state
Paul Berry
2016/06/11 13:02:15
Done.
|
+ _assertTrue("try { return 1; } finally {}"); |
+ } |
+ |
+ void test_tryStatement_return_try_oneCatchDoesNotExit() { |
+ _assertFalse("try { return 1; } catch (e, s) {} finally {}"); |
+ } |
+ |
+ void test_tryStatement_return_try_oneCatchExits() { |
+ _assertTrue("try { return 1; } catch (e, s) { return 1; } finally {}"); |
+ } |
+ |
+ void test_tryStatement_return_try_twoCatchesDoExit() { |
+ _assertTrue(''' |
+try { return 1; } |
+on int catch (e, s) { return 1; } |
+on String catch (e, s) { return 1; } |
+finally {}'''); |
+ } |
+ |
+ void test_tryStatement_return_try_twoCatchesDoNotExit() { |
+ _assertFalse(''' |
+try { return 1; } |
+on int catch (e, s) {} |
+on String catch (e, s) {} |
+finally {}'''); |
+ } |
+ |
+ void test_tryStatement_return_try_twoCatchesMixed() { |
+ _assertFalse(''' |
+try { return 1; } |
+on int catch (e, s) {} |
+on String catch (e, s) { return 1; } |
+finally {}'''); |
} |
void test_variableDeclarationStatement_noInitializer() { |
@@ -3987,28 +4019,28 @@ void f() sync* { |
_assertNthStatementDoesNotExit(source, 0); |
} |
- void test_yieldStatement_throw() { |
+ void test_yieldStatement_star_plain() { |
Source source = addSource(r''' |
void f() sync* { |
- yield throw ''; |
+ yield* 1; |
} |
'''); |
- _assertNthStatementExits(source, 0); |
+ _assertNthStatementDoesNotExit(source, 0); |
} |
- void test_yieldStatement_star_plain() { |
+ void test_yieldStatement_star_throw() { |
Source source = addSource(r''' |
void f() sync* { |
- yield* 1; |
+ yield* throw ''; |
} |
'''); |
- _assertNthStatementDoesNotExit(source, 0); |
+ _assertNthStatementExits(source, 0); |
} |
- void test_yieldStatement_star_throw() { |
+ void test_yieldStatement_throw() { |
Source source = addSource(r''' |
void f() sync* { |
- yield* throw ''; |
+ yield throw ''; |
} |
'''); |
_assertNthStatementExits(source, 0); |
@@ -4025,14 +4057,14 @@ void f() sync* { |
// Assert that the [n]th statement in the last function declaration of |
// [source] exits. |
- void _assertNthStatementExits(Source source, int n) { |
- _assertHasReturn(true, source, n); |
+ void _assertNthStatementDoesNotExit(Source source, int n) { |
+ _assertHasReturn(false, source, n); |
} |
// Assert that the [n]th statement in the last function declaration of |
// [source] does not exit. |
- void _assertNthStatementDoesNotExit(Source source, int n) { |
- _assertHasReturn(false, source, n); |
+ void _assertNthStatementExits(Source source, int n) { |
+ _assertHasReturn(true, source, n); |
} |
} |