mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 20:39:34 +02:00
parent
1b371b15e3
commit
5de5fa9b7b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2585,6 +2585,7 @@ packages/fcl-passrc/src/readme.txt svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcbaseparser.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcclasstype.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcexprparser.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcgenerics.pp svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcmoduleparser.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tconstparser.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcpassrcutil.pas svneol=native#text/plain
|
||||
|
@ -2605,6 +2605,7 @@ begin
|
||||
ExpectToken(tkEqual);
|
||||
NextToken;
|
||||
Case CurToken of
|
||||
tkObject,
|
||||
tkClass :
|
||||
begin
|
||||
ClassEl := TPasClassType(CreateElement(TPasClassType,
|
||||
|
39
packages/fcl-passrc/tests/tcgenerics.pp
Normal file
39
packages/fcl-passrc/tests/tcgenerics.pp
Normal file
@ -0,0 +1,39 @@
|
||||
unit tcgenerics;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, pparser, pastree, testregistry, tctypeparser;
|
||||
|
||||
Type
|
||||
|
||||
{ TTestGenerics }
|
||||
|
||||
TTestGenerics = Class(TBaseTestTypeParser)
|
||||
Published
|
||||
Procedure TestObjectGenerics;
|
||||
Procedure TestSpecializationDelphi;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure TTestGenerics.TestObjectGenerics;
|
||||
begin
|
||||
Source.Add('Type');
|
||||
Source.Add('Generic TSomeClass<T> = Object');
|
||||
Source.Add(' b : T;');
|
||||
Source.Add('end;');
|
||||
ParseDeclarations;
|
||||
end;
|
||||
|
||||
procedure TTestGenerics.TestSpecializationDelphi;
|
||||
begin
|
||||
ParseType('TFPGList<integer>',TPasClassType,'');
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTest(TTestGenerics);
|
||||
end.
|
||||
|
@ -161,7 +161,6 @@ type
|
||||
Procedure TestReferencePointer;
|
||||
Procedure TestInvalidColon;
|
||||
Procedure TestTypeHelper;
|
||||
Procedure TestSpecializationDelphi;
|
||||
end;
|
||||
|
||||
{ TTestRecordTypeParser }
|
||||
@ -3306,10 +3305,6 @@ begin
|
||||
ParseType('Type Helper for AnsiString end',TPasClassType,'');
|
||||
end;
|
||||
|
||||
procedure TTestTypeParser.TestSpecializationDelphi;
|
||||
begin
|
||||
ParseType('TFPGList<integer>',TPasClassType,'');
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTests([TTestTypeParser,TTestRecordTypeParser,TTestProcedureTypeParser]);
|
||||
|
@ -30,7 +30,7 @@
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
<CommandLineParams Value="--suite=TTestStatementParser.TestCaseElseNoSemicolon"/>
|
||||
<CommandLineParams Value="--suite=TTestScanner.TestSelf"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
@ -38,7 +38,7 @@
|
||||
<PackageName Value="FCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="13">
|
||||
<Units Count="14">
|
||||
<Unit0>
|
||||
<Filename Value="testpassrc.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -91,6 +91,10 @@
|
||||
<Filename Value="tcresolver.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="tcgenerics.pp"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit13>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
@ -5,7 +5,7 @@ program testpassrc;
|
||||
uses
|
||||
Classes, consoletestrunner, tcscanner, tctypeparser, tcstatements,
|
||||
tcbaseparser, tcmoduleparser, tconstparser, tcvarparser, tcclasstype,
|
||||
tcexprparser, tcprocfunc, tcpassrcutil, tcresolver;
|
||||
tcexprparser, tcprocfunc, tcpassrcutil, tcresolver, tcgenerics;
|
||||
|
||||
type
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user