feat: add new tests for loops
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
for (int i = 0; i < 5; i = i - 1)
|
||||
{}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
while (true)
|
||||
{}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
int i = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
for (int i = 0; i < 10; i = i + 1)
|
||||
printline("check");
|
||||
|
||||
int i = 0;
|
||||
for (i = 0; i <= 5; i = i + 1)
|
||||
{
|
||||
printline("i is:");
|
||||
printline(i);
|
||||
}
|
||||
|
||||
if (i < 5)
|
||||
{
|
||||
printline("external declared `i` != 5");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
while (i > 0)
|
||||
{
|
||||
i = i - 1;
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
printline("decreased in while loop `i` > 0");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user