(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func TestComposeMessageMultipleRecipients(t *testing.T) { |
| 142 | raw, err := ComposeMessage( |
| 143 | "from@test.com", |
| 144 | []string{"alice@gmail.com", "bob@gmail.com"}, |
| 145 | []string{"carol@gmail.com"}, |
| 146 | "Hello", |
| 147 | "Body", |
| 148 | "text/plain", |
| 149 | "", |
| 150 | nil, |
| 151 | "test.dev", |
| 152 | "", |
| 153 | "", |
| 154 | ) |
| 155 | if err != nil { |
| 156 | t.Fatalf("ComposeMessage failed: %v", err) |
| 157 | } |
| 158 | |
| 159 | msg, _ := mail.ReadMessage(strings.NewReader(string(raw))) |
| 160 | if got := msg.Header.Get("To"); got != "alice@gmail.com, bob@gmail.com" { |
| 161 | t.Errorf("To = %q, want alice@gmail.com, bob@gmail.com", got) |
| 162 | } |
| 163 | if got := msg.Header.Get("Cc"); got != "carol@gmail.com" { |
| 164 | t.Errorf("Cc = %q, want carol@gmail.com", got) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | func TestComposeMessageCCOnlyOmitsToHeader(t *testing.T) { |
| 169 | raw, err := ComposeMessage( |
nothing calls this directly
no test coverage detected