From a93b1416a7e37fb9543adc50879d498b10d881ac Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 19 Jun 2019 19:18:48 +0200 Subject: [PATCH] Add unit tests for wxControl::SetLabelMarkup() too Check that "&" is interpreted correctly. --- tests/controls/label.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/controls/label.cpp b/tests/controls/label.cpp index bb8cf168b8..b9153e3f13 100644 --- a/tests/controls/label.cpp +++ b/tests/controls/label.cpp @@ -66,6 +66,16 @@ void DoTestLabel(wxControl* c) // And GetLabel() should be the escaped version of the text 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