Add unit tests for wxControl::SetLabelMarkup() too

Check that "&" is interpreted correctly.
This commit is contained in:
Vadim Zeitlin
2019-06-19 19:18:48 +02:00
parent 21babfa2d0
commit a93b1416a7

View File

@@ -66,6 +66,16 @@ void DoTestLabel(wxControl* c)
// And GetLabel() should be the escaped version of the text // And GetLabel() should be the escaped version of the text
CHECK( l == wxControl::RemoveMnemonics(c->GetLabel()) ); CHECK( l == wxControl::RemoveMnemonics(c->GetLabel()) );
} }
#if wxUSE_MARKUP
c->SetLabelMarkup("mnemonic in &markup");
CHECK( c->GetLabel() == "mnemonic in &markup" );
CHECK( c->GetLabelText() == "mnemonic in markup" );
c->SetLabelMarkup("&& finally");
CHECK( c->GetLabel() == "&& finally" );
CHECK( c->GetLabelText() == "& finally" );
#endif // wxUSE_MARKUP
} }
} // anonymous namespace } // anonymous namespace