mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 12:40:20 +02:00
codetools: added test for anonymous expr as arg and dot operator
git-svn-id: trunk@59844 -
This commit is contained in:
parent
07d328aeaa
commit
fc5c60b0fd
@ -102,6 +102,7 @@ type
|
||||
procedure TestFindDeclaration_Attributes;
|
||||
procedure TestFindDeclaration_BracketOpen;
|
||||
procedure TestFindDeclaration_AnonymProc;
|
||||
procedure TestFindDeclaration_AnonymProc_ExprDot;
|
||||
// test all files in directories:
|
||||
procedure TestFindDeclaration_FPCTests;
|
||||
procedure TestFindDeclaration_LazTests;
|
||||
@ -952,7 +953,7 @@ begin
|
||||
' end;',
|
||||
' DoIt(function(i: int{declaration:int}): int{declaration:int}',
|
||||
' begin',
|
||||
' a{declaration:doit.a}:=b{declaration:doit.sub.b}+c{declaration:doit.sub.$ano.c};',
|
||||
' a{declaration:doit.a}:=b{declaration:doit.sub.b}+i{declaration:doit.sub.$ano.i};',
|
||||
' end);',
|
||||
' end;',
|
||||
'begin',
|
||||
@ -963,6 +964,31 @@ begin
|
||||
FindDeclarations(Code);
|
||||
end;
|
||||
|
||||
procedure TTestFindDeclaration.TestFindDeclaration_AnonymProc_ExprDot;
|
||||
begin
|
||||
StartProgram;
|
||||
Add([
|
||||
'{$mode objfpc}{$modeswitch closures}',
|
||||
'type',
|
||||
' int = word;',
|
||||
' TFunc = function(i: int): int;',
|
||||
'var f: TFunc;',
|
||||
'function DoIt(f: TProc): TObject{declaration:system.tobject};',
|
||||
'begin',
|
||||
' DoIt(nil).ClassInfo{declaration:system.tobject.classinfo};',
|
||||
' DoIt(function(c: int{declaration:int}): int{declaration:int}',
|
||||
' begin',
|
||||
' repeat until true;',
|
||||
' asm end;',
|
||||
' try except end;',
|
||||
' end).ClassInfo{declaration:system.tobject.classinfo};',
|
||||
'end;',
|
||||
'begin',
|
||||
'end.',
|
||||
'']);
|
||||
FindDeclarations(Code);
|
||||
end;
|
||||
|
||||
procedure TTestFindDeclaration.TestFindDeclaration_FPCTests;
|
||||
begin
|
||||
TestFiles('fpctests');
|
||||
|
Loading…
Reference in New Issue
Block a user