fpc/tests/webtbs/tw2382.pp
fpc 790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00

45 lines
642 B
ObjectPascal

var
sa : array[0..2] of char;
s: string;
begin
sa := '';
s := sa;
if length(s) <> 0 then
begin
writeln('error 0');
halt(1);
end;
sa := 'a';
s := sa;
if length(s) <> 1 then
begin
writeln('error 1');
halt(1);
end;
sa := 'ab';
s := sa;
if length(s) <> 2 then
begin
writeln('error 2');
halt(1);
end;
sa := 'abc';
// check for possible overflow in assignment
s[4] := '1';
s := sa;
if length(s) <> 3 then
begin
writeln('error 3');
halt(1);
end;
if s[4] <> '1' then
begin
writeln('error 4');
halt(1);
end;
end.