]> git.saurik.com Git - wxWidgets.git/commitdiff
Add another test for the insertion point position after SetValue().
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Nov 2010 21:37:54 +0000 (21:37 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 5 Nov 2010 21:37:54 +0000 (21:37 +0000)
Verify that setting the value of a previously not empty control resets
the insertion point to its beginning.

See #10051.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/controls/textentrytest.cpp

index e28fc4809f11904ff4ea602a16952599bd6f4a73..81f9e41bc8c919aca80f5060f7b9c4437fb78d6c 100644 (file)
@@ -144,6 +144,9 @@ void TextEntryTestCase::InsertionPoint()
     entry->WriteText("-"); // should move it after the written text
     CPPUNIT_ASSERT_EQUAL( 4, entry->GetLastPosition() );
     CPPUNIT_ASSERT_EQUAL( 1, entry->GetInsertionPoint() );
+
+    entry->SetValue("something different"); // should still reset the caret
+    CPPUNIT_ASSERT_EQUAL( 0, entry->GetInsertionPoint() );
 }
 
 void TextEntryTestCase::Replace()