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 GitHub
parent e72cc7dd73
commit af3b4074e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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));
}