diff --git a/backend/test/password.cpp b/backend/test/password.cpp index 7fa8976..228ca38 100644 --- a/backend/test/password.cpp +++ b/backend/test/password.cpp @@ -3,15 +3,18 @@ #include #include "../src/password.hpp" -bool hasLettersAndDigit(const std::string &password) +namespace { - const std::regex pattern("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$"); - return regex_match(password, pattern); -} + bool hasLettersAndDigit(const std::string &password) + { + const std::regex pattern("^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$"); + return regex_match(password, pattern); + } -bool hasSymbol(const std::string &password) -{ - return password.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890") != std::string::npos; + bool hasSymbol(const std::string &password) + { + return password.find_first_not_of("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890") != std::string::npos; + } } TEST_CASE("Test generatePassword creates valid passwords")