fpc/tests/webtbs/tw2250.pp
florian edaa0b3014 * changing tests to fix regressions is only the last resort, so this should be sorted out by other means, r19116 reverted
--- Reverse-merging r19116 into '.':
U    tests\webtbs\tw4675.pp
U    tests\webtbs\tw7758.pp
U    tests\webtbs\tw18702.pp
U    tests\webtbs\tw3595.pp
U    tests\webtbs\tw5001.pp
U    tests\webtbs\tw2250.pp
U    tests\webtbs\tw3492.pp
U    tests\webtbs\tw16004.pp
 G   .
--- Recording mergeinfo for reverse merge of r19116 into '.':
 G   .

git-svn-id: trunk@19135 -
2011-09-17 18:19:47 +00:00

32 lines
673 B
ObjectPascal

{ Source provided for Free Pascal Bug Report 2250 }
{ Submitted by "Konstantin Seiler" on 2002-12-04 }
{ e-mail: list@kseiler.de }
procedure stringbug;
var env:ansistring;
procedure addenv(s:ansistring);
begin
// Uncomment next line and everything works as espected.
//writeln(length(env));
if length(env)=0 then env:=s
else env:=env+'|'+s;
end;
begin
env:='';
addenv('first');
addenv('second');
addenv('third');
// It schould write "first|second|third",
// but only writes "third".
writeln(env);
if env<>'first|second|third' then
begin
writeln('ERROR!');
halt(1);
end;
end;
begin
stringbug;
end.