Fix passphrase generator test (#10890)

* Fix passphrase generator test

Previously, the test case was assuming the wrong regex. In particular, the default word list (eff_large.wordlist) contains several words that contain dashes. Adjust the regex used in the test to reflect this. This should fix rare test failures
This commit is contained in:
Carlo Teubner 2024-06-12 22:21:53 +01:00 committed by Jonathan White
parent 64eb3d0c82
commit abcff25e57
No known key found for this signature in database
GPG Key ID: 440FC65F2E0C6E01

View File

@ -49,6 +49,6 @@ void TestPassphraseGenerator::testWordCase()
generator.setWordCase(PassphraseGenerator::TITLECASE);
passphrase = generator.generatePassphrase();
QRegularExpression regex("^([A-Z][a-z]* ?)+$");
QVERIFY(regex.match(passphrase).hasMatch());
QRegularExpression regex("^(?:[A-Z][a-z-]* )*[A-Z][a-z-]*$");
QVERIFY2(regex.match(passphrase).hasMatch(), qPrintable(passphrase));
}