mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
PY-48235 Add quoting policy for PyXCopyValueAction
IJ-CR-110671 GitOrigin-RevId: 768a88b91943de9dcab5c5023073c82c5f8c93d7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
34d15a1d21
commit
c368c2f4f1
@@ -13,10 +13,7 @@ import com.intellij.xdebugger.breakpoints.SuspendPolicy;
|
||||
import com.intellij.xdebugger.frame.XValueChildrenList;
|
||||
import com.jetbrains.env.PyEnvTestCase;
|
||||
import com.jetbrains.python.console.pydev.PydevCompletionVariant;
|
||||
import com.jetbrains.python.debugger.PyDebugValue;
|
||||
import com.jetbrains.python.debugger.PyDebuggerException;
|
||||
import com.jetbrains.python.debugger.PyExceptionBreakpointProperties;
|
||||
import com.jetbrains.python.debugger.PyExceptionBreakpointType;
|
||||
import com.jetbrains.python.debugger.*;
|
||||
import com.jetbrains.python.debugger.pydev.ProcessDebugger;
|
||||
import com.jetbrains.python.debugger.settings.PyDebuggerSettings;
|
||||
import com.jetbrains.python.sdk.flavors.PythonSdkFlavor;
|
||||
@@ -31,6 +28,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.jetbrains.python.debugger.PyDebugUtilsKt.getQuotingString;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
@@ -1708,6 +1706,41 @@ public class PythonDebuggerTest extends PyEnvTestCase {
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testQuotingInCopyAction() {
|
||||
runPythonTest(new PyDebuggerTask("/debug", "test_quoting_value.py") {
|
||||
private void testQuotingValue(String value) throws PyDebuggerException {
|
||||
var variable = myDebugProcess.evaluate(value, false, false).getValue();
|
||||
for (var policy : QuotingPolicy.values()) {
|
||||
String result = getQuotingString(policy, variable);
|
||||
switch (policy) {
|
||||
case DOUBLE -> assertFalse(result.contains("'"));
|
||||
case SINGLE -> assertFalse(result.contains("\""));
|
||||
case NONE -> {
|
||||
assertFalse(result.contains("'"));
|
||||
assertFalse(result.contains("\""));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void before() {
|
||||
toggleBreakpoint(getFilePath(getScriptName()), 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void testing() throws Exception {
|
||||
waitForPause();
|
||||
testQuotingValue("car");
|
||||
testQuotingValue("some_str");
|
||||
testQuotingValue("some_lst");
|
||||
testQuotingValue("some_dict");
|
||||
resume();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static class PyDebuggerTaskTagAware extends PyDebuggerTask {
|
||||
|
||||
private PyDebuggerTaskTagAware(@Nullable String relativeTestDataPath, String scriptName) {
|
||||
|
||||
Reference in New Issue
Block a user