IDEA-19328 "Simple blocks on one line" and "Force braces" aren't applied ideally

Corresponding test is added
This commit is contained in:
Denis Zhdanov
2010-05-12 16:16:03 +04:00
parent de8be3bd7d
commit de4e9790d0

View File

@@ -15,6 +15,8 @@
*/
package com.intellij.psi.formatter.java;
import com.intellij.psi.codeStyle.CodeStyleSettings;
/**
* Is intended to hold specific java formatting tests for 'braces placement' settings (
* <code>Project Settings - Code Style - Alignment and Braces</code>).
@@ -59,4 +61,16 @@ public class JavaFormatterBracesTest extends AbstractJavaFormatterTest {
" }\n" +
"}");
}
public void testSimpleBlockInOneLinesAndForceBraces() throws Exception {
// Inspired by IDEA-19328
getSettings().KEEP_SIMPLE_BLOCKS_IN_ONE_LINE = true;
getSettings().IF_BRACE_FORCE = CodeStyleSettings.FORCE_BRACES_ALWAYS;
doMethodTest(
"if (x > y) System.out.println(\"foo!\");",
"if (x > y) { System.out.println(\"foo!\"); }"
);
}
}