Browse Source

Add BreakUnlessContinue test case

pull/832/head
Daniel Grunwald 8 years ago
parent
commit
1a8ce7d345
  1. 19
      ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs

19
ICSharpCode.Decompiler/Tests/TestCases/Correctness/ControlFlow.cs

@ -38,6 +38,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -38,6 +38,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
Test("test", ref result);
Console.WriteLine(result);
ForeachWithAssignment(new int[] { 1, 5, 25 });
BreakUnlessContinue(true);
BreakUnlessContinue(false);
return 0;
}
@ -117,5 +119,22 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -117,5 +119,22 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
Console.WriteLine(i);
}
}
static void BreakUnlessContinue(bool b)
{
Console.WriteLine("BreakUnlessContinue({0})", b);
for (int i = 0; i < 5; i++) {
if ((i % 3) == 0)
continue;
Console.WriteLine(i);
if (b) {
Console.WriteLine("continuing");
continue;
}
Console.WriteLine("breaking out of loop");
break;
}
Console.WriteLine("BreakUnlessContinue (end)");
}
}
}
Loading…
Cancel
Save