mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-15 02:12:55 +01:00
Update smtp_test.go to add more authentication test cases
Enhanced the LoginAuth test coverage by adding new scenarios with different sequences and invalid cases. This ensures more robust validation and better handling of edge cases in authentication testing.
This commit is contained in:
parent
547f78dbee
commit
93752280aa
1 changed files with 24 additions and 3 deletions
|
@ -57,10 +57,31 @@ var authTests = []authTest{
|
|||
},
|
||||
{
|
||||
LoginAuth("user", "pass", "testserver"),
|
||||
[]string{"Username:", "Password:", "User Name\x00", "Password\x00", "Invalid:"},
|
||||
[]string{"Username:", "Password:"},
|
||||
"LOGIN",
|
||||
[]string{"", "user", "pass", "user", "pass", ""},
|
||||
[]bool{false, false, false, false, true},
|
||||
[]string{"", "user", "pass"},
|
||||
[]bool{false, false},
|
||||
},
|
||||
{
|
||||
LoginAuth("user", "pass", "testserver"),
|
||||
[]string{"User Name\x00", "Password\x00"},
|
||||
"LOGIN",
|
||||
[]string{"", "user", "pass"},
|
||||
[]bool{false, false},
|
||||
},
|
||||
{
|
||||
LoginAuth("user", "pass", "testserver"),
|
||||
[]string{"Invalid", "Invalid:"},
|
||||
"LOGIN",
|
||||
[]string{"", "user", "pass"},
|
||||
[]bool{false, false},
|
||||
},
|
||||
{
|
||||
LoginAuth("user", "pass", "testserver"),
|
||||
[]string{"Invalid", "Invalid:", "Too many"},
|
||||
"LOGIN",
|
||||
[]string{"", "user", "pass", ""},
|
||||
[]bool{false, false, true},
|
||||
},
|
||||
{
|
||||
CRAMMD5Auth("user", "pass"),
|
||||
|
|
Loading…
Reference in a new issue