From 8c6f93b899e438402ad0630eb60d3dcea413f852 Mon Sep 17 00:00:00 2001 From: Andrius Semionovas Date: Mon, 12 Jun 2017 21:39:04 +0300 Subject: [PATCH] Add tests for KEEP_LINE_BREAKS --- .../formatter/KeepLineBreak.after.inv.kt | 18 ++++++++++++++++++ idea/testData/formatter/KeepLineBreak.after.kt | 15 +++++++++++++++ idea/testData/formatter/KeepLineBreak.kt | 18 ++++++++++++++++++ .../formatter/FormatterTestGenerated.java | 12 ++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 idea/testData/formatter/KeepLineBreak.after.inv.kt create mode 100644 idea/testData/formatter/KeepLineBreak.after.kt create mode 100644 idea/testData/formatter/KeepLineBreak.kt 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");