Skip to content

Commit 06b3fce

Browse files
committed
Fixed test case and replaced hidden Unicode character for address injection tests
- Replaced hidden Unicode character with explicit `\u200c` in the `TestMsg_addressCmdInjectsions` test. - Refactored test structure to use shorthand declaration for improved readability.
1 parent 158baff commit 06b3fce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

msg_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2895,7 +2895,7 @@ func TestMsg_GetRecipients(t *testing.T) {
28952895
}
28962896

28972897
func TestMsg_addressCmdInjectsions(t *testing.T) {
2898-
var tests = []struct {
2898+
tests := []struct {
28992899
name string
29002900
payload string
29012901
shouldFail bool
@@ -2938,7 +2938,7 @@ func TestMsg_addressCmdInjectsions(t *testing.T) {
29382938

29392939
// unicode / homoglyphs
29402940
{"unicode-fullwidth", `"toni.tester@example.com> ORCPT=admin@example.com"@example.com`, false},
2941-
{"unicode-hidden", `"toni.tester@example.com> ORCPT=admin@exam‌ple.com"@example.com`, false},
2941+
{"unicode-hidden", `"toni.tester@example.com> ORCPT=admin@exam` + "\u200c" + `ple.com"@example.com`, false},
29422942

29432943
// multiple @ / nested-at attempts
29442944
{"nested-at", `"toni.tester@example.com> ORCPT=admin@sub@example.com"@example.com`, false},

0 commit comments

Comments
 (0)