failing test for PY-1065

This commit is contained in:
Dmitry Jemerov
2010-09-21 14:37:42 +04:00
parent 7f86a1eb60
commit fd2b9895f0
6 changed files with 31 additions and 0 deletions
@@ -176,6 +176,7 @@
serviceImplementation="com.jetbrains.python.psi.resolve.PythonPathCache"/>
<preserveIndentOnPaste fileType="Python"/>
<lang.whiteSpaceFormattingStrategy language="Python" implementationClass="com.jetbrains.python.formatter.PyWhiteSpaceFormattingStrategy"/>
<!-- Django -->
<codeInsight.lineMarkerProvider language="Python" implementationClass="com.jetbrains.django.annotator.ViewMethodLineMarkerProvider"/>
@@ -98,9 +98,11 @@ public class PyBlock implements ASTBlock {
// whitespace between sub-blocks would include \ characters,
// because the IDEA 5.0/5.1 formatter core requires that whitespace
// between blocks must include whitespace-only characters
/*
if (child.getText().indexOf('\\') >= 0) {
return Collections.emptyList();
}
*/
continue;
}
@@ -0,0 +1,20 @@
package com.jetbrains.python.formatter;
import com.intellij.formatting.WhiteSpaceFormattingStrategy;
import org.jetbrains.annotations.NotNull;
/**
* @author yole
*/
public class PyWhiteSpaceFormattingStrategy implements WhiteSpaceFormattingStrategy {
@Override
public int check(@NotNull CharSequence text, int start, int end) {
for (int i = start; i < end; i++) {
char c = text.charAt(i);
if (c != ' ' && c != '\t' && c != '\n' && c != '\\') {
return i;
}
}
return end;
}
}
@@ -0,0 +1,2 @@
import contextlib,\
math,decimal
@@ -0,0 +1,2 @@
import contextlib,\
math, decimal
@@ -72,6 +72,10 @@ public class PyFormatterTest extends PyLightFixtureTestCase {
doTest();
}
public void _testSpaceAfterCommaWrappedLine() { // PY-1065
doTest();
}
private void doTest() {
myFixture.configureByFile("formatter/" + getTestName(true) + ".py");
ApplicationManager.getApplication().runWriteAction(new Runnable() {