style: consistent testcase name formatting

This commit is contained in:
ae 2025-04-01 12:20:31 +03:00
parent 993b576d0d
commit 9324bb5321
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E

View File

@ -78,9 +78,18 @@ func TestCreateUser_InvalidUsername(t *testing.T) {
name string
body string
}{
{"Too short", `{"username": "a", "password": "validPass123!"}`},
{"Invalid chars", `{"username": "user@name", "password": "validPass123!"}`},
{"Empty", `{"username": "", "password": "validPass123!"}`},
{
"too short",
`{"username": "a", "password": "validPass123!"}`,
},
{
"invalid chars",
`{"username": "user@name", "password": "validPass123!"}`,
},
{
"empty",
`{"username": "", "password": "validPass123!"}`,
},
}
for _, tc := range tests {
@ -101,9 +110,18 @@ func TestCreateUser_InvalidPassword(t *testing.T) {
name string
body string
}{
{"too short", fmt.Sprintf(`{"username": "valid", "password": "%s"}`, strings.Repeat("a", minPasswordLength-1))},
{"too long", fmt.Sprintf(`{"username": "valid", "password": "%s"}`, strings.Repeat("a", maxPasswordLength+1))},
{"low entropy", fmt.Sprintf(`{"username": "valid", "password": "%s"}`, strings.Repeat("a", minPasswordLength))},
{
"too short",
fmt.Sprintf(`{"username": "valid", "password": "%s"}`, strings.Repeat("a", minPasswordLength-1)),
},
{
"too long",
fmt.Sprintf(`{"username": "valid", "password": "%s"}`, strings.Repeat("a", maxPasswordLength+1)),
},
{
"low entropy",
fmt.Sprintf(`{"username": "valid", "password": "%s"}`, strings.Repeat("a", minPasswordLength)),
},
}
for _, tc := range tests {