EditorMacroScript: More tests

git-svn-id: trunk@39402 -
This commit is contained in:
martin 2012-11-28 19:28:04 +00:00
parent a78197d384
commit c2891838cf

View File

@ -371,7 +371,7 @@ begin
); );
// SelText // SelText
DoTestSimple('SelText', 'Test'+ LineEnding + 'Ö Foo' + LineEnding, DoTestSimple('SelText (read)', 'Test'+ LineEnding + 'Ö Foo' + LineEnding,
'var s: String; begin ' + LineEnding + 'var s: String; begin ' + LineEnding +
's := caller.SelText;' + LineEnding + 's := caller.SelText;' + LineEnding +
'Caller.CaretXY := point(2,1);' + LineEnding + 'Caller.CaretXY := point(2,1);' + LineEnding +
@ -389,7 +389,28 @@ begin
'Test', 'Test',
5, 2 5, 2
); );
DoTestSimple('SelText (write)', 'Test'+ LineEnding + 'Ö Foo' + LineEnding,
'caller.SelText := ''X'';',
' Xo',
5, 2, -1, -1, True, 8, 2 // select "Fo"
);
// ClearSelection (does delete the text)
DoTestSimple('ClearSelection', 'Test123',
'caller.ClearSelection;',
'T123',
2, 1, -1, -1, True, 5, 1 // select "est"
);
// SelectAll
DoTestSimple('SelectAll', 'Test123',
'caller.SelectAll;' + LineEnding +
'caller.SelText := '''';',
''+LineEnding,
2, 1, -1, -1, False, 5, 1 // select "est"
);
// SelectionMode
{%endregion Selection *} {%endregion Selection *}