View | Details | Raw Unified | Return to bug 298844 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/formatter/FormatterBugsTests.java (+38 lines)
Lines 5673-5678 Link Here
5673
}
5673
}
5674
5674
5675
/**
5675
/**
5676
 * @bug 298844: [formatter] New lines in empty method body wrong behavior
5677
 * @test Verify that comment is well indented inside empty constructor and method
5678
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=298844"
5679
 */
5680
public void testBug298844a() {
5681
	this.formatterPrefs.insert_new_line_in_empty_method_body = false;
5682
	String source = 
5683
		"public class X01 {\n" + 
5684
		"public X01() {\n" + 
5685
		"// TODO Auto-generated constructor stub\n" + 
5686
		"}\n" + 
5687
		"}\n";
5688
	formatSource(source,
5689
		"public class X01 {\n" + 
5690
		"	public X01() {\n" + 
5691
		"		// TODO Auto-generated constructor stub\n" + 
5692
		"	}\n" + 
5693
		"}\n"
5694
	);
5695
}
5696
public void testBug298844b() {
5697
	this.formatterPrefs.insert_new_line_in_empty_method_body = false;
5698
	String source = 
5699
		"public class X02 {\n" + 
5700
		"public void foo() {\n" + 
5701
		"	// TODO Auto-generated constructor stub\n" + 
5702
		"}\n" + 
5703
		"}\n";
5704
	formatSource(source,
5705
		"public class X02 {\n" + 
5706
		"	public void foo() {\n" + 
5707
		"		// TODO Auto-generated constructor stub\n" + 
5708
		"	}\n" + 
5709
		"}\n"
5710
	);
5711
}
5712
5713
/**
5676
 * @bug 302123: [formatter] AssertionFailedException occurs while formatting a source containing the specific javadoc comment...
5714
 * @bug 302123: [formatter] AssertionFailedException occurs while formatting a source containing the specific javadoc comment...
5677
 * @test Verify that no exception occurs while formatting source including the specific comment
5715
 * @test Verify that no exception occurs while formatting source including the specific comment
5678
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=302123"
5716
 * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=302123"

Return to bug 298844