Files
4566704 a6ba78c92c feat(mail): 自 go-hua 迁入 SMTP 邮件发送封装
- SendToMail 支持收/抄/密送与回复地址、HTML 或文本正文
- 附测试、examples/mail 例程与包 README(注明不支持 465 加密端口)
2026-09-20 12:29:38 +08:00

23 lines
552 B
Go

package mail
import "testing"
func TestMergeSlice(t *testing.T) {
got := MergeSlice([]string{"a@t.com", "b@t.com"}, []string{"c@t.com"})
if len(got) != 3 {
t.Fatalf("MergeSlice 长度 = %d, want 3", len(got))
}
want := map[string]bool{"a@t.com": true, "b@t.com": true, "c@t.com": true}
for _, s := range got {
if !want[s] {
t.Errorf("MergeSlice 结果包含意外元素 %q", s)
}
}
}
func TestMergeSliceEmpty(t *testing.T) {
if got := MergeSlice(nil, nil); len(got) != 0 {
t.Errorf("空输入 MergeSlice = %v, want 空", got)
}
}