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

Unified Diff: pkg/analysis_server/test/services/refactoring/extract_method_test.dart

Issue 871013012: Issue 22188. Verify that none or all execution flows return. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/refactoring/extract_method_test.dart
diff --git a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
index 98de0cab65ed56dd747b35a3e7eba6470ef42afd..952974b75a29247b5cc3e869ecaae9503a655227 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -440,6 +440,23 @@ main() {
"local variables and return statement.");
}
+ test_bad_statements_return_notAllExecutionFlows() {
+ indexTestUnit('''
+main(int p) {
+// start
+ if (p == 0) {
+ return;
+ }
+// end
+ print(p);
+}
+''');
+ _createRefactoringForStartEndComments();
+ return _assertConditionsError(
+ "Selected statements contain a return statement, but not all possible "
Paul Berry 2015/02/10 18:25:16 Nit: it would be nice to put this string in a cons
+ "execuion flows end in a return. Semantics may not be preserved.");
+ }
+
test_bad_switchCase() {
indexTestUnit('''
main() {

Powered by Google App Engine
This is Rietveld 408576698