From 4245b8129cd2e3e2bfc253e5229290735cf4eeaf Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 16 Oct 2015 21:37:22 +0000 Subject: [PATCH] codetools: added tests bug #28866 git-svn-id: trunk@50086 - --- .gitattributes | 2 + .../codetools/tests/finddeclarationtest.lpi | 10 +++- .../codetools/tests/laztests/bug28866_prg.pas | 15 ++++++ .../tests/laztests/bug28866_unit1.pas | 49 +++++++++++++++++++ 4 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 components/codetools/tests/laztests/bug28866_prg.pas create mode 100644 components/codetools/tests/laztests/bug28866_unit1.pas diff --git a/.gitattributes b/.gitattributes index 5c5ba1c92e..1531618206 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1013,6 +1013,8 @@ components/codetools/tests/fpctests/tchlp7.pp svneol=native#text/plain components/codetools/tests/laztests/README.txt svneol=native#text/plain components/codetools/tests/laztests/bug28861_unit1.pas svneol=native#text/plain components/codetools/tests/laztests/bug28861_unit2.pas svneol=native#text/plain +components/codetools/tests/laztests/bug28866_prg.pas svneol=native#text/plain +components/codetools/tests/laztests/bug28866_unit1.pas svneol=native#text/plain components/codetools/tests/laztests/tdefaultproperty1.pas svneol=native#text/plain components/codetools/tests/parsertbase.pas svneol=native#text/plain components/codetools/tests/parsertest.lpi svneol=native#text/plain diff --git a/components/codetools/tests/finddeclarationtest.lpi b/components/codetools/tests/finddeclarationtest.lpi index d7de4f82b3..48409e75e4 100644 --- a/components/codetools/tests/finddeclarationtest.lpi +++ b/components/codetools/tests/finddeclarationtest.lpi @@ -40,7 +40,7 @@ - + @@ -85,6 +85,14 @@ + + + + + + + + diff --git a/components/codetools/tests/laztests/bug28866_prg.pas b/components/codetools/tests/laztests/bug28866_prg.pas new file mode 100644 index 0000000000..e62d66ae24 --- /dev/null +++ b/components/codetools/tests/laztests/bug28866_prg.pas @@ -0,0 +1,15 @@ +program bug28866_prg; + +{$mode objfpc}{$H+} + +uses + bug28866_unit1; + +var + S: String; + O: TObject; +begin + S.Twice{declaration:bug28866_unit1.TStringHelper.Twice}; + O.Test{declaration:bug28866_unit1.TObjectHelper.Test}; +end. + diff --git a/components/codetools/tests/laztests/bug28866_unit1.pas b/components/codetools/tests/laztests/bug28866_unit1.pas new file mode 100644 index 0000000000..f3a14ef5fd --- /dev/null +++ b/components/codetools/tests/laztests/bug28866_unit1.pas @@ -0,0 +1,49 @@ +unit bug28866_unit1; + +{$mode delphi} + +interface + +{ TStringHelper } + +type + TStringHelper = record helper for string + private + function GetTheLength: Integer; + public + function Twice: string; + function Thrice: string; + property TheLength: Integer read GetTheLength; + end; + + TObjectHelper = class helper for TObject + public + function Test: Integer; + end; + +implementation + +{ TObjectHelper } + +function TObjectHelper.Test: Integer; +begin + +end; + +function TStringHelper.GetTheLength: Integer; +begin + Result := Length(Self) +end; + +function TStringHelper.Twice: string; +begin + Result := Self + Self; +end; + +function TStringHelper.Thrice: string; +begin + Result := Self + Self + Self; +end; + +end. +