Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestPasswordGenerator.cpp')
-rw-r--r--tests/TestPasswordGenerator.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/TestPasswordGenerator.cpp b/tests/TestPasswordGenerator.cpp
index b043a7cd0..89e2eb91c 100644
--- a/tests/TestPasswordGenerator.cpp
+++ b/tests/TestPasswordGenerator.cpp
@@ -29,6 +29,19 @@ void TestPasswordGenerator::initTestCase()
QVERIFY(Crypto::init());
}
+void TestPasswordGenerator::testAdditionalChars()
+{
+ PasswordGenerator generator;
+ QVERIFY(!generator.isValid());
+ generator.setAdditionalChars("aql");
+ generator.setLength(2000);
+ QVERIFY(generator.isValid());
+ QString password = generator.generatePassword();
+ QCOMPARE(password.size(), 2000);
+ QRegularExpression regex(R"(^[aql]+$)");
+ QVERIFY(regex.match(password).hasMatch());
+}
+
void TestPasswordGenerator::testCharClasses()
{
PasswordGenerator generator;