mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 15:00:26 +02:00
codetools: added test for complete method with specialize param
git-svn-id: trunk@56318 -
This commit is contained in:
parent
c8498f15df
commit
5a24b63f1f
@ -19,6 +19,7 @@ type
|
||||
Expected: array of string);
|
||||
published
|
||||
procedure TestIntfProcUpdateArgName;
|
||||
procedure TestCompleteMethodBody_ParamSpecialize;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -41,7 +42,13 @@ begin
|
||||
if not CodeToolBoss.CompleteCode(Code,Col,Line,Line,NewCode,NewX,NewY,NewTopLine,
|
||||
BlockTopLine,BlockBottomLine,false) then
|
||||
begin
|
||||
WriteSource(Code.Filename,Line,Col);
|
||||
NewY:=Line;
|
||||
NewX:=Col;
|
||||
if CodeToolBoss.ErrorLine>0 then begin
|
||||
NewY:=CodeToolBoss.ErrorLine;
|
||||
NewX:=CodeToolBoss.ErrorColumn;
|
||||
end;
|
||||
WriteSource(Code.Filename,NewY,NewX);
|
||||
Fail(Title+'call CompleteCode failed: '+CodeToolBoss.ErrorDbgMsg);
|
||||
end;
|
||||
s:='';
|
||||
@ -70,6 +77,38 @@ begin
|
||||
,'end.']);
|
||||
end;
|
||||
|
||||
procedure TTestCodeCompletion.TestCompleteMethodBody_ParamSpecialize;
|
||||
begin
|
||||
Test('TestCompleteMethodBody_ParamSpecialize',
|
||||
['unit test1;',
|
||||
'{$mode objfpc}{$H+}',
|
||||
'interface',
|
||||
'type',
|
||||
' TBird = class',
|
||||
' procedure DoIt(i: specialize TGenList<longint>);',
|
||||
' end;',
|
||||
'implementation',
|
||||
'end.'],
|
||||
6,1,
|
||||
['unit test1;',
|
||||
'{$mode objfpc}{$H+}',
|
||||
'interface',
|
||||
'type',
|
||||
'',
|
||||
' { TBird }',
|
||||
'',
|
||||
' TBird = class',
|
||||
' procedure DoIt(i: specialize TGenList<longint>);',
|
||||
' end;',
|
||||
'implementation',
|
||||
'',
|
||||
'procedure TBird.DoIt(i: specialize TGenList<longint>);',
|
||||
'begin',
|
||||
'end;',
|
||||
'',
|
||||
'end.']);
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTests([TTestCodeCompletion]);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user