mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 05:58:14 +02:00
EditorMacroScript: More tests
git-svn-id: trunk@39412 -
This commit is contained in:
parent
a3df269512
commit
49904b6e13
@ -448,11 +448,51 @@ begin
|
||||
);
|
||||
|
||||
|
||||
// SelectionMode
|
||||
// TODO: SelectionMode
|
||||
{%endregion Selection *}
|
||||
|
||||
|
||||
{%region Logical / Physical *}
|
||||
// LogicalToPhysicalPos
|
||||
DoTestSimple('LogicalToPhysicalPos', ' öabc',
|
||||
'var p: TPoint; begin'+LineEnding+
|
||||
' p := Caller.LogicalToPhysicalPos(point(4,1));'+LineEnding+ // "a|b"
|
||||
' Caller.InsertTextAtCaret(inttostr(p.x)+'',''+inttostr(p.y), scamBegin);'+LineEnding+
|
||||
'end.',
|
||||
'3,1');
|
||||
|
||||
// LogicalToPhysicalCol
|
||||
DoTestSimple('LogicalToPhysicalCol', ' öabc'+LineEnding+'x',
|
||||
'var i: Integer; begin'+LineEnding+
|
||||
' i := Caller.LogicalToPhysicalCol(''ööabc'', 2, 6);'+LineEnding+ // "a|b"
|
||||
' Caller.InsertTextAtCaret(inttostr(i), scamBegin);'+LineEnding+
|
||||
'end.',
|
||||
'4');
|
||||
|
||||
// PhysicalToLogicalPos
|
||||
DoTestSimple('PhysicalToLogicalPos', ' öabc',
|
||||
'var p: TPoint; begin'+LineEnding+
|
||||
' p := Caller.PhysicalToLogicalPos(point(3,1));'+LineEnding+ // "a|b"
|
||||
' Caller.InsertTextAtCaret(inttostr(p.x)+'',''+inttostr(p.y), scamBegin);'+LineEnding+
|
||||
'end.',
|
||||
'4,1');
|
||||
|
||||
// PhysicalToLogicalCol
|
||||
DoTestSimple('PhysicalToLogicalCol', ' öabc'+LineEnding+'x',
|
||||
'var i: Integer; begin'+LineEnding+
|
||||
' i := Caller.PhysicalToLogicalCol(''ööabc'', 2, 4);'+LineEnding+ // "a|b"
|
||||
' Caller.InsertTextAtCaret(inttostr(i), scamBegin);'+LineEnding+
|
||||
'end.',
|
||||
'6');
|
||||
|
||||
// PhysicalLineLength
|
||||
DoTestSimple('PhysicalLineLength', ' öabc'+LineEnding+'x',
|
||||
'var i: Integer; begin'+LineEnding+
|
||||
' i := Caller.PhysicalLineLength(''ööabc'', 2);'+LineEnding+
|
||||
' Caller.InsertTextAtCaret(inttostr(i), scamBegin);'+LineEnding+
|
||||
'end.',
|
||||
'5');
|
||||
|
||||
{%endregion Logical / Physical *}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user