Browse Source

failing tests for issue 35

newNRvisualizers
Alex Mizuki 13 years ago
parent
commit
3f465c60f9
  1. 79
      ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs

79
ICSharpCode.NRefactory.Tests/FormattingTests/TestFormattingBugs.cs

@ -227,7 +227,84 @@ foo (); @@ -227,7 +227,84 @@ foo ();
}
}");
}
/// <summary>
/// Bug GH35 - Formatter issues with if/else statements and // comments
/// </summary>
[Test()]
public void TestBugGH35()
{
var policy = new CSharpFormattingOptions();
policy.ConstructorBraceStyle = BraceStyle.EndOfLine;
Test(policy, @"public class A : B
{
public void Test()
{
// Comment before
if (conditionA) {
DoSomething();
}
// Comment before else ends up incorporating it
else if (conditionB) {
DoSomethingElse();
}
}
}",
@"public class A : B
{
public void Test()
{
// Comment before
if (conditionA) {
DoSomething();
}
// Comment before else ends up incorporating it
else if (conditionB) {
DoSomethingElse();
}
}
}");
}
/// <summary>
/// Bug GH35a - Formatter issues with if/else statements and // comments else variant
/// </summary>
[Test()]
public void TestBugGH35a()
{
var policy = new CSharpFormattingOptions();
policy.ConstructorBraceStyle = BraceStyle.EndOfLine;
Test(policy, @"public class A : B
{
public void Test()
{
// Comment before
if (conditionA) {
DoSomething();
}
// Comment before else ends up incorporating it
else (conditionB) {
DoSomethingElse();
}
}
}",
@"public class A : B
{
public void Test()
{
// Comment before
if (conditionA) {
DoSomething();
}
// Comment before else ends up incorporating it
else (conditionB) {
DoSomethingElse();
}
}
}");
}
}
}

Loading…
Cancel
Save