From 2a2166092c4c6876a4302a6579590a61a17ebf97 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Fri, 15 Feb 2013 19:47:10 +0400 Subject: [PATCH] fix CR-IC-97 (indent is counted in tab units so need multiplication instead of division) handle empty insertion line properly --- python/testData/copyPaste/IndentTabIncrease.after.py | 6 ++++++ python/testData/copyPaste/IndentTabIncrease.dst.py | 5 +++++ python/testData/copyPaste/IndentTabIncrease.src.py | 5 +++++ python/testSrc/com/jetbrains/python/PyCopyPasteTest.java | 8 ++++++++ 4 files changed, 24 insertions(+) create mode 100644 python/testData/copyPaste/IndentTabIncrease.after.py create mode 100644 python/testData/copyPaste/IndentTabIncrease.dst.py create mode 100644 python/testData/copyPaste/IndentTabIncrease.src.py diff --git a/python/testData/copyPaste/IndentTabIncrease.after.py b/python/testData/copyPaste/IndentTabIncrease.after.py new file mode 100644 index 000000000000..1683b2e27c33 --- /dev/null +++ b/python/testData/copyPaste/IndentTabIncrease.after.py @@ -0,0 +1,6 @@ +print "Line 2" +class Test: + def __init__(self): + print "Line 2" + + print "Line 1" diff --git a/python/testData/copyPaste/IndentTabIncrease.dst.py b/python/testData/copyPaste/IndentTabIncrease.dst.py new file mode 100644 index 000000000000..a05ccaa81f85 --- /dev/null +++ b/python/testData/copyPaste/IndentTabIncrease.dst.py @@ -0,0 +1,5 @@ +print "Line 2" +class Test: + def __init__(self): + + print "Line 1" diff --git a/python/testData/copyPaste/IndentTabIncrease.src.py b/python/testData/copyPaste/IndentTabIncrease.src.py new file mode 100644 index 000000000000..3052f957ab5d --- /dev/null +++ b/python/testData/copyPaste/IndentTabIncrease.src.py @@ -0,0 +1,5 @@ +print "Line 2" + +class Test: + def __init__(self): + print "Line 1" diff --git a/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java b/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java index cc542f5aca6e..901e9fc77b6e 100644 --- a/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java +++ b/python/testSrc/com/jetbrains/python/PyCopyPasteTest.java @@ -270,6 +270,10 @@ public class PyCopyPasteTest extends PyTestCase { } public void testIndentTab() { + doTestTabs(); + } + + private void doTestTabs() { final CommonCodeStyleSettings.IndentOptions indentOptions = CodeStyleSettingsManager.getSettings(myFixture.getProject()) .getIndentOptions(PythonFileType.INSTANCE); @@ -282,6 +286,10 @@ public class PyCopyPasteTest extends PyTestCase { } } + public void testIndentTabIncrease() { + doTestTabs(); + } + private void doTest() { String name = getTestName(false);