tests for aligning binary and ternary expressions in groovy (IDEA-74585,IDEA-74586)

This commit is contained in:
peter
2011-09-22 17:37:22 +02:00
parent 7ad766e127
commit 6191ce529a
3 changed files with 20 additions and 0 deletions
@@ -156,6 +156,16 @@ public class FormatterTest extends GroovyFormatterTestCase {
doTest();
}
public void testAlignBinaries() throws Throwable {
myTempSettings.ALIGN_MULTILINE_BINARY_OPERATION = true;
doTest();
}
public void testAlignTernaries() throws Throwable {
myTempSettings.ALIGN_MULTILINE_TERNARY_OPERATION = true;
doTest();
}
public void doTest() {
final List<String> data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test");
checkFormatting(data.get(0), StringUtil.trimEnd(data.get(1), "\n"));
@@ -0,0 +1,5 @@
def foo = 2 +
2
-----
def foo = 2 +
2
@@ -0,0 +1,5 @@
def foo = true ? 2 :
2
-----
def foo = true ? 2 :
2