Add delete-entry command to Browser Integration API

This commit is contained in:
varjolintu
2021-09-06 18:38:25 +03:00
committed by Jonathan White
parent e3c7b570ae
commit 4c10e516c3
8 changed files with 116 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2021 KeePassXC Team <team@keepassxc.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -88,3 +88,20 @@ void TestTools::testEnvSubstitute()
QCOMPARE(Tools::envSubstitute("start/$EMPTY$$EMPTY$HOME/end", environment), QString("start/$/home/user/end"));
#endif
}
void TestTools::testValidUuid()
{
auto validUuid = Tools::uuidToHex(QUuid::createUuid());
auto nonValidUuid = "1234567890abcdef1234567890abcdef";
auto emptyUuid = QString();
auto shortUuid = validUuid.left(10);
auto longUuid = validUuid + "baddata";
auto nonHexUuid = Tools::uuidToHex(QUuid::createUuid()).replace(0, 1, 'p');
QVERIFY(Tools::isValidUuid(validUuid));
QVERIFY(not Tools::isValidUuid(nonValidUuid));
QVERIFY(not Tools::isValidUuid(emptyUuid));
QVERIFY(not Tools::isValidUuid(shortUuid));
QVERIFY(not Tools::isValidUuid(longUuid));
QVERIFY(not Tools::isValidUuid(nonHexUuid));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
* Copyright (C) 2021 KeePassXC Team <team@keepassxc.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@ private slots:
void testIsHex();
void testIsBase64();
void testEnvSubstitute();
void testValidUuid();
};
#endif // KEEPASSX_TESTTOOLS_H