fpc/tests/test/tcmp0.pp
Jonas Maebe a68581efef * fixed test (comparechar0 is defined as returning values <, =, > 0, not
just -1, 0, 1)

git-svn-id: trunk@9220 -
2007-11-12 21:25:27 +00:00

24 lines
483 B
ObjectPascal

program comparechar0bug;
var str1 : pchar = 'test';
str2 : pchar = 'test';
str3 : pchar = 'testa';
str4 : pchar = 'asdf';
res : longint;
begin
res:=CompareChar0(str1[0],str2[0],maxint);
if res<>0 then
halt(1);
res:=CompareChar0(str1[0],str3[0],maxint);
if res>=0 then
halt(1);
res:=CompareChar0(str4[0],str1[0],maxint);
if res>=0 then
halt(1);
res:=CompareChar0(str1[0],str4[0],maxint);
if res<=0 then
halt(1);
writeln('ok');
end.