fix wxTextCtrl::Replace() under wxGTK; added unit test for it and describe its effect on the insertion point
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57253 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -165,3 +165,27 @@ void TextEntryTestCase::InsertionPoint()
|
||||
CPPUNIT_ASSERT_EQUAL( 1, entry->GetInsertionPoint() );
|
||||
}
|
||||
|
||||
void TextEntryTestCase::Replace()
|
||||
{
|
||||
wxTextEntry * const entry = GetTestEntry();
|
||||
|
||||
entry->SetValue("Hello replace\n"
|
||||
"0123456789012");
|
||||
entry->SetInsertionPoint(0);
|
||||
|
||||
entry->Replace(6, 13, "changed");
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL("Hello changed\n"
|
||||
"0123456789012",
|
||||
entry->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(13, entry->GetInsertionPoint());
|
||||
|
||||
entry->Replace(13, -1, "");
|
||||
CPPUNIT_ASSERT_EQUAL("Hello changed", entry->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(13, entry->GetInsertionPoint());
|
||||
|
||||
entry->Replace(0, 6, "Un");
|
||||
CPPUNIT_ASSERT_EQUAL("Unchanged", entry->GetValue());
|
||||
CPPUNIT_ASSERT_EQUAL(2, entry->GetInsertionPoint());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user