mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Escape accelerators
(fixes issue #12037) Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
committed by
Jonathan White
parent
fedcbf60c5
commit
44daca921a
@@ -451,3 +451,14 @@ void TestTools::testCleanUsername_data()
|
||||
QTest::newRow("Trailing dots and spaces") << "username... " << "username";
|
||||
QTest::newRow("Combination of issues") << R"( user<>:"/\|?*name... )" << "user_________name";
|
||||
}
|
||||
|
||||
void TestTools::testEscapeAccelerators()
|
||||
{
|
||||
QCOMPARE(Tools::escapeAccelerators(""), "");
|
||||
QCOMPARE(Tools::escapeAccelerators("NoAccelerator"), "NoAccelerator");
|
||||
QCOMPARE(Tools::escapeAccelerators("&Accelerator"), "&&Accelerator");
|
||||
QCOMPARE(Tools::escapeAccelerators("Accelerator&"), "Accelerator&&");
|
||||
QCOMPARE(Tools::escapeAccelerators("Accel&erator&"), "Accel&&erator&&");
|
||||
QCOMPARE(Tools::escapeAccelerators("Accel&&erator"), "Accel&&&&erator");
|
||||
QCOMPARE(Tools::escapeAccelerators("Some & text"), "Some && text");
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ private slots:
|
||||
void testIsTextMimeType();
|
||||
void testCleanUsername();
|
||||
void testCleanUsername_data();
|
||||
void testEscapeAccelerators();
|
||||
};
|
||||
|
||||
#endif // KEEPASSX_TESTTOOLS_H
|
||||
|
||||
Reference in New Issue
Block a user