mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Visit else in while in any case even if condition is True (PY-28972)
But when condition is `True`, edge to `else` is not created.
This commit is contained in:
@@ -274,6 +274,11 @@ public class PyControlFlowBuilderTest extends LightMarkedTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-28972
|
||||
public void testWhileTrueElse() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTestFirstStatement() {
|
||||
final String testName = getTestName(false).toLowerCase();
|
||||
configureByFile(testName + ".py");
|
||||
|
||||
@@ -117,6 +117,16 @@ public class PyUnreachableCodeInspectionTest extends PyInspectionTestCase {
|
||||
);
|
||||
}
|
||||
|
||||
// PY-28972
|
||||
public void testWhileTrueElse() {
|
||||
doTestByText(
|
||||
"while True:\n" +
|
||||
" pass\n" +
|
||||
"else:\n" +
|
||||
" <warning descr=\"This code is unreachable\">print(\"ok\")</warning>"
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends PyInspection> getInspectionClass() {
|
||||
|
||||
@@ -270,4 +270,9 @@ public class PyExtractMethodTest extends LightMarkedTestCase {
|
||||
public void testCommentsPrecedingSourceStatement() {
|
||||
doTest("func");
|
||||
}
|
||||
|
||||
// PY-28972
|
||||
public void testInterruptedOuterLoop() {
|
||||
doFail("foo", "Cannot perform refactoring when execution flow is interrupted");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user