codetools: test complete method with specialize in delphi mode

git-svn-id: trunk@56322 -
This commit is contained in:
mattias 2017-11-06 14:52:47 +00:00
parent 4cae594814
commit dd4b6615a3
2 changed files with 34 additions and 0 deletions

View File

@ -20,6 +20,7 @@ type
published
procedure TestIntfProcUpdateArgName;
procedure TestCompleteMethodBody_ParamSpecialize;
procedure TestCompleteMethodBody_ParamDelphiSpecialize;
end;
implementation
@ -109,6 +110,38 @@ begin
'end.']);
end;
procedure TTestCodeCompletion.TestCompleteMethodBody_ParamDelphiSpecialize;
begin
Test('TestCompleteMethodBody_ParamSpecialize',
['unit test1;',
'{$mode delphi}',
'interface',
'type',
' TBird = class',
' procedure DoIt(i: TGenList<longint>);',
' end;',
'implementation',
'end.'],
6,1,
['unit test1;',
'{$mode delphi}',
'interface',
'type',
'',
' { TBird }',
'',
' TBird = class',
' procedure DoIt(i: TGenList<longint>);',
' end;',
'implementation',
'',
'procedure TBird.DoIt(i: TGenList<longint>);',
'begin',
'end;',
'',
'end.']);
end;
initialization
RegisterTests([TTestCodeCompletion]);
end.

View File

@ -558,6 +558,7 @@ procedure TTestFindDeclaration.TestFindDeclaration_GenericFunction;
begin
StartProgram;
Add([
'{$mode objfpc}',
'generic function RandomFrom<T>(const AValues:array of T):T;',
'begin',
' Result:=Avalue[1];',