codetools: tests with

git-svn-id: trunk@50265 -
This commit is contained in:
mattias 2015-11-09 21:47:46 +00:00
parent a98baa8442
commit 7395b9b047
3 changed files with 28 additions and 9 deletions

View File

@ -1486,10 +1486,22 @@ begin
// RemoveWithHeader
SourceChangeCache.MainScanner:=Scanner;
if not FindBounds then exit;
if not RemoveWithHeader then exit;
if not UnindentAndEncloseSkippedCode then exit;
if not PrefixSubIdentifiers then exit;
if not FindBounds then begin
debugln(['TExtractProcTool.RemoveWithBlock FindBounds failed']);
exit;
end;
if not RemoveWithHeader then begin
debugln(['TExtractProcTool.RemoveWithBlock RemoveWithHeader failed']);
exit;
end;
if not UnindentAndEncloseSkippedCode then begin
debugln(['TExtractProcTool.RemoveWithBlock UnindentAndEncloseSkippedCode failed']);
exit;
end;
if not PrefixSubIdentifiers then begin
debugln(['TExtractProcTool.RemoveWithBlock PrefixSubIdentifiers failed']);
exit;
end;
Result:=SourceChangeCache.Apply;
//debugln(['TExtractProcTool.RemoveWithBlock SOURCE:']);

View File

@ -100,7 +100,7 @@ begin
end;
// check each marker
Src:=Code.Source;
//debugln(['TTestRefactoring.TestExplodeWith ',copy(Src,NewStartPos,NewEndPos-NewStartPos)]);
//debugln(['TTestRefactoring.TestExplodeWith NewBlock=',copy(Src,NewStartPos,NewEndPos-NewStartPos)]);
p:=NewStartPos;
repeat
CommentStartPos:=FindNextComment(Src,p,NewEndPos);

View File

@ -13,6 +13,8 @@ type
TMyClass = class
public
Parent: TMyClass;
Left: string;
procedure DoSomething;
end;
@ -22,11 +24,16 @@ implementation
procedure TMyClass.DoSomething;
var
R: TRect;
R1: TRect;
begin
R:=Rect(1,2,3,4);
with R do
{explodewith:R}Left:=4;
R1:=Rect(1,2,3,4);
with R1 do
{explodewith:R1}Left:=4;
if R1.Left= 4 then ;
with Parent do
{explodewith:Parent}Left:='A';
with Parent.Parent do
{explodewith:Parent}Left:='A';
end;
end.