Add tests showing transferring data (to, from) self (window) works correctly

This commit is contained in:
ali kettab 2021-02-22 14:31:20 +01:00
parent db33e1549b
commit ec20753685

View File

@ -184,4 +184,30 @@ TEXT_VALIDATOR_TEST_CASE("wxTextValidator::IsValid", "[wxTextValidator][filters]
}
}
TEXT_VALIDATOR_TEST_CASE("wxTextValidator::TransferToWindow", "[wxTextValidator][transferdata]")
{
wxString value = "wxwidgets";
wxTextValidator val(wxFILTER_ALPHA, &value);
m_text->SetValidator(val);
CHECK( m_text->IsEmpty() );
REQUIRE( m_text->TransferDataToWindow() );
CHECK( m_text->GetValue() == "wxwidgets" );
}
TEXT_VALIDATOR_TEST_CASE("wxTextValidator::TransferFromWindow", "[wxTextValidator][transferdata]")
{
wxString value;
wxTextValidator val(wxFILTER_ALPHA, &value);
m_text->SetValidator(val);
m_text->ChangeValue("wxwidgets");
REQUIRE( m_text->TransferDataFromWindow() );
CHECK( value == "wxwidgets" );
}
#endif // wxUSE_VALIDATORS && wxUSE_UIACTIONSIMULATOR