mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-23 13:30:00 +01:00
test for 877
This commit is contained in:
parent
48174a41fe
commit
3dd1e2bc61
31
tests/webtbs/tbug877.pp
Normal file
31
tests/webtbs/tbug877.pp
Normal file
@ -0,0 +1,31 @@
|
||||
{$mode objfpc}
|
||||
|
||||
program testlist;
|
||||
uses
|
||||
Sysutils,
|
||||
Classes;
|
||||
var
|
||||
l: TList;
|
||||
IsCaught: boolean;
|
||||
|
||||
|
||||
|
||||
begin
|
||||
L:= TList.Create;
|
||||
IsCaught:=false;
|
||||
Try
|
||||
WriteLn(LongInt(L[0]));{L[0] not exist, ==> access violation}
|
||||
L.Free;
|
||||
Except
|
||||
on eListError do
|
||||
begin
|
||||
Writeln('Exception caught');
|
||||
IsCaught:=true;
|
||||
end;
|
||||
end;
|
||||
If not IsCaught then
|
||||
begin
|
||||
Writeln('Error in TList');
|
||||
Halt(1);
|
||||
end;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user