[formatter] allow empty blocks IDEA-162000

This commit is contained in:
Yaroslav Lepenkin
2016-11-24 17:13:29 +03:00
parent dad861243c
commit 5b68c2e9f8
2 changed files with 16 additions and 3 deletions
@@ -343,7 +343,6 @@ public class InitialInfoBuilder {
checkInsideFormatterOffTag(rootBlock);
TextRange textRange = rootBlock.getTextRange();
checkRange(textRange);
if (myPreviousBlock != null) {
myPreviousBlock.setNextBlock(info);
@@ -32,16 +32,30 @@ class FormatterEngineTests : LightPlatformTestCase() {
@Test
fun `test simple alignment`() {
doTest(
"""
"""
[a0]fooooo [a1]foo
[a0]go [a1]boo
""",
"""
"""
fooooo foo
go boo
""")
}
@Test
fun `test empty block alignment`() {
doTest(
"""
[a0]fooooo [a1]
[a0]go [a1]boo
""",
"""
fooooo
go boo
""")
}
}
fun doTest(before: String, expectedText: String) {