diff options
Diffstat (limited to 'tests/TestPasswordGenerator.cpp')
-rw-r--r-- | tests/TestPasswordGenerator.cpp | 13 |
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; |