(t *testing.T)
| 114 | } |
| 115 | |
| 116 | func TestExtractThreadInfoToCcLists(t *testing.T) { |
| 117 | raw := []byte("Message-Id: <m@gmail.com>\r\nSubject: Group\r\nFrom: alice@example.com\r\n" + |
| 118 | "To: \"Bot A\" <bot-a@example.com>, bot-b@example.com\r\n" + |
| 119 | "Cc: watcher@example.com\r\n\r\nbody\r\n") |
| 120 | |
| 121 | info := extractThreadInfo(raw) |
| 122 | |
| 123 | wantTo := []string{"bot-a@example.com", "bot-b@example.com"} |
| 124 | if !reflect.DeepEqual(info.To, wantTo) { |
| 125 | t.Errorf("To = %v, want %v", info.To, wantTo) |
| 126 | } |
| 127 | if !reflect.DeepEqual(info.CC, []string{"watcher@example.com"}) { |
| 128 | t.Errorf("CC = %v, want [watcher@example.com]", info.CC) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func TestExtractAddressListEmptyAndMalformed(t *testing.T) { |
| 133 | if got := extractAddressList(""); got != nil { |
nothing calls this directly
no test coverage detected