mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 20:50:39 +02:00
codetools: test FindCodeContext with missing close bracket
git-svn-id: trunk@56516 -
This commit is contained in:
parent
5a96d17edc
commit
18a2d7544e
@ -44,6 +44,7 @@ type
|
||||
published
|
||||
procedure Test_GetValuesOfCaseVariable_Enum;
|
||||
procedure Test_FindCodeContext_ProcParams;
|
||||
procedure Test_FindCodeContext_ProcParams_NoClosingBracket;
|
||||
procedure Test_FindCodeContext_ProcTypeParams;
|
||||
procedure Test_FindCodeContext_AttributeParams;
|
||||
end;
|
||||
@ -130,6 +131,40 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTestIdentCompletion.Test_FindCodeContext_ProcParams_NoClosingBracket;
|
||||
var
|
||||
SrcMark: TFDMarker;
|
||||
CursorPos: TCodeXYPosition;
|
||||
CodeContexts: TCodeContextInfo;
|
||||
begin
|
||||
StartProgram;
|
||||
Add([
|
||||
'{#a}procedure DoIt(i, j: longint);',
|
||||
'begin',
|
||||
'end;',
|
||||
'begin',
|
||||
' DoIt({#c}',
|
||||
'end.']);
|
||||
ParseSimpleMarkers(Code);
|
||||
SrcMark:=FindMarker('c','#');
|
||||
AssertNotNull('missing src marker #c',SrcMark);
|
||||
MainTool.CleanPosToCaret(SrcMark.CleanPos,CursorPos);
|
||||
CodeContexts:=nil;
|
||||
try
|
||||
if not CodeToolBoss.FindCodeContext(Code,CursorPos.X,CursorPos.Y,CodeContexts)
|
||||
then begin
|
||||
WriteSource(CursorPos);
|
||||
Fail('CodeToolBoss.FindCodeContext');
|
||||
end;
|
||||
AssertEquals('CodeContexts.Count',1,CodeContexts.Count);
|
||||
//for i:=0 to CodeContexts.Count-1 do
|
||||
// debugln(['TTestIdentCompletion.Test_FindCodeContext_ProcParams ',i,' ',CodeContexts[i].AsDebugString(true)]);
|
||||
CheckCodeContext(CodeContexts[0],'a');
|
||||
finally
|
||||
CodeContexts.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTestIdentCompletion.Test_FindCodeContext_ProcTypeParams;
|
||||
var
|
||||
SrcMark: TFDMarker;
|
||||
|
Loading…
Reference in New Issue
Block a user