pascalabcnet/TestSuite/formatter_tests/should/while1.pas
Бондарев Иван 136a60fdf3 fix #1218
fix #1219
fix #1220
2018-09-20 21:21:16 +02:00

28 lines
461 B
ObjectPascal

begin
var i := 1;
var s := 0;
while i < 5 do
begin
s := s + i;
Inc(i);
end;
assert(s = 10);
var flag := false;
while not flag do
begin
i := 3;
flag := true;
end;
assert(i = 3);
var enum: (one, two, three) := one;
while enum < three do
begin
Inc(enum);
end;
assert(enum = three);
i := 0;
var arr: array of integer;
SetLength(arr, 5);
while (i < 5) and (arr[i] = 0) do Inc(i);
assert(i = 5);
end.