(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func TestExtractThreadInfo(t *testing.T) { |
| 47 | raw := []byte("Message-Id: <abc123@gmail.com>\r\nSubject: Hello Agent\r\nFrom: alice@example.com\r\nTo: bot@agent.example.com\r\n\r\nHi there\r\n") |
| 48 | |
| 49 | info := extractThreadInfo(raw) |
| 50 | |
| 51 | if info.MessageID != "<abc123@gmail.com>" { |
| 52 | t.Errorf("MessageID = %q, want %q", info.MessageID, "<abc123@gmail.com>") |
| 53 | } |
| 54 | if info.Subject != "Hello Agent" { |
| 55 | t.Errorf("Subject = %q, want %q", info.Subject, "Hello Agent") |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | func TestExtractThreadInfoWithReplyHeaders(t *testing.T) { |
| 60 | raw := []byte("Message-Id: <reply@gmail.com>\r\nSubject: Re: Hello\r\nIn-Reply-To: <orig@agent.com>\r\nReferences: <first@agent.com> <orig@agent.com>\r\nFrom: alice@example.com\r\nTo: bot@agent.example.com\r\n\r\nReply body\r\n") |
nothing calls this directly
no test coverage detected