mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
New test
This commit is contained in:
parent
601b08fb2d
commit
b900ec1a4a
2 changed files with 54 additions and 0 deletions
49
IDE/Tests/CompileFail001/src/Defer.bf
Normal file
49
IDE/Tests/CompileFail001/src/Defer.bf
Normal file
|
@ -0,0 +1,49 @@
|
|||
#pragma warning disable 168
|
||||
|
||||
using System;
|
||||
|
||||
namespace IDETest
|
||||
{
|
||||
class Defer
|
||||
{
|
||||
public int ReturnFromDefer()
|
||||
{
|
||||
defer
|
||||
{
|
||||
return 123; //FAIL
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int BreakFromDefer()
|
||||
{
|
||||
for (int i < 10)
|
||||
{
|
||||
defer
|
||||
{
|
||||
break; //FAIL
|
||||
}
|
||||
|
||||
defer
|
||||
{
|
||||
continue; //FAIL
|
||||
}
|
||||
}
|
||||
|
||||
Block:
|
||||
for (int j < 20)
|
||||
{
|
||||
for (int i < 10)
|
||||
{
|
||||
defer
|
||||
{
|
||||
//break Block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue