+
+void TextCtrlTestCase::InsertionPoint()
+{
+ CPPUNIT_ASSERT_EQUAL( 0, m_text->GetLastPosition() );
+ CPPUNIT_ASSERT_EQUAL( 0, m_text->GetInsertionPoint() );
+
+ m_text->SetValue("0"); // should put the insertion point in front
+ CPPUNIT_ASSERT_EQUAL( 1, m_text->GetLastPosition() );
+ CPPUNIT_ASSERT_EQUAL( 0, m_text->GetInsertionPoint() );
+
+ m_text->AppendText("12"); // should update the insertion point position
+ CPPUNIT_ASSERT_EQUAL( 3, m_text->GetLastPosition() );
+ CPPUNIT_ASSERT_EQUAL( 3, m_text->GetInsertionPoint() );
+
+ m_text->SetInsertionPoint(1);
+ CPPUNIT_ASSERT_EQUAL( 3, m_text->GetLastPosition() );
+ CPPUNIT_ASSERT_EQUAL( 1, m_text->GetInsertionPoint() );
+
+ m_text->SetInsertionPointEnd();
+ CPPUNIT_ASSERT_EQUAL( 3, m_text->GetInsertionPoint() );
+
+ m_text->SetInsertionPoint(0);
+ m_text->WriteText("-"); // should move it after the written text
+ CPPUNIT_ASSERT_EQUAL( 4, m_text->GetLastPosition() );
+ CPPUNIT_ASSERT_EQUAL( 1, m_text->GetInsertionPoint() );
+}
+