codetools: test for regression due to generic type fixes

git-svn-id: trunk@64980 -
This commit is contained in:
pascal 2021-04-13 08:16:29 +00:00
parent ce93f694d9
commit 052438a840

View File

@ -39,6 +39,7 @@ type
procedure TestCompleteProperty_TypeGenericDelphi;
procedure TestCompleteProperty_GenericObjFPC;
procedure TestCompleteProperty_GenericDelphi;
procedure TestCompleteVariableWithSpecializedType;
end;
implementation
@ -816,6 +817,46 @@ begin
'end.']);
end;
procedure TTestCodeCompletion.TestCompleteVariableWithSpecializedType;
begin
Test('TestCompleteVariableWithSpecializedType (not fixed so far)',
['program Project1;',
'{$mode objfpc}{$H+}',
'uses',
' Generics.Collections;',
'type',
' generic TObjectList2<T> = class(specialize TObjectList<T>)',
' end;',
' TList = specialize TObjectList2<TObject>;',
' TClass = class',
' List: TList;',
' end;',
'var',
' Base: TObject;',
'begin',
' List := TClass(Base).List;',
'end.'],
15,3,
['program Project1;',
'{$mode objfpc}{$H+}',
'uses',
' Generics.Collections;',
'type',
' generic TObjectList2<T> = class(specialize TObjectList<T>)',
' end;',
' TList = specialize TObjectList2<TObject>;',
' TClass = class',
' List: TList;',
' end;',
'var',
' Base: TObject;',
' List: TList;',
'begin',
' List := TClass(Base).List;',
'end.']);
end;
initialization
RegisterTests([TTestCodeCompletion]);
end.