diff --git a/idea/testData/formatter/KeepLineBreak.after.inv.kt b/idea/testData/formatter/KeepLineBreak.after.inv.kt new file mode 100644 index 00000000000..d72520e4ae9 --- /dev/null +++ b/idea/testData/formatter/KeepLineBreak.after.inv.kt @@ -0,0 +1,18 @@ +fun foo() { + if + (true) { + + } + + while + (true) { + + } + + for + (i in 0..42) { + + } +} + +// SET_FALSE: KEEP_LINE_BREAKS \ No newline at end of file diff --git a/idea/testData/formatter/KeepLineBreak.after.kt b/idea/testData/formatter/KeepLineBreak.after.kt new file mode 100644 index 00000000000..196048b6ec4 --- /dev/null +++ b/idea/testData/formatter/KeepLineBreak.after.kt @@ -0,0 +1,15 @@ +fun foo() { + if (true) { + + } + + while (true) { + + } + + for (i in 0..42) { + + } +} + +// SET_FALSE: KEEP_LINE_BREAKS \ No newline at end of file diff --git a/idea/testData/formatter/KeepLineBreak.kt b/idea/testData/formatter/KeepLineBreak.kt new file mode 100644 index 00000000000..6fd01d087a2 --- /dev/null +++ b/idea/testData/formatter/KeepLineBreak.kt @@ -0,0 +1,18 @@ +fun foo() { + if + (true) { + + } + + while + (true) { + + } + + for + (i in 0..42) { + + } +} + +// SET_FALSE: KEEP_LINE_BREAKS \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java b/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java index 20e3c794212..1c6de7b6307 100644 --- a/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/formatter/FormatterTestGenerated.java @@ -404,6 +404,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest { doTest(fileName); } + @TestMetadata("KeepLineBreak.after.kt") + public void testKeepLineBreak() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/KeepLineBreak.after.kt"); + doTest(fileName); + } + @TestMetadata("LabeledExpression.after.kt") public void testLabeledExpression() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/LabeledExpression.after.kt"); @@ -1076,6 +1082,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest { doTestInverted(fileName); } + @TestMetadata("KeepLineBreak.after.inv.kt") + public void testKeepLineBreak() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/KeepLineBreak.after.inv.kt"); + doTestInverted(fileName); + } + @TestMetadata("LambdaArrow.after.inv.kt") public void testLambdaArrow() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/LambdaArrow.after.inv.kt");