aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/email/parser_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-07-03 18:24:39 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-07-03 18:24:39 +0200
commitebabe267cda9c25d5789f647339d237893eed10e (patch)
treedc605ff16357695eefba776710cfbbb0ce55dca2 /pkg/email/parser_test.go
parent2181ef35e17d97286cfe7edad5d4d68c225922d9 (diff)
pkg/email: don't add own email address to CC list
Otherwise we we send each reply to ourselves and receive it again.
Diffstat (limited to 'pkg/email/parser_test.go')
-rw-r--r--pkg/email/parser_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/pkg/email/parser_test.go b/pkg/email/parser_test.go
index 8d8e675e4..7b2aa9a0f 100644
--- a/pkg/email/parser_test.go
+++ b/pkg/email/parser_test.go
@@ -26,10 +26,10 @@ func TestExtractCommand(t *testing.T) {
func TestExtractBugID(t *testing.T) {
for i, test := range extractBugIDTests {
t.Run(fmt.Sprint(i), func(t *testing.T) {
- bugID := extractBugID(test.email, `"Foo Bar" <foo@bar.com>`)
- if bugID != test.bugID {
- t.Logf("expect: %q", test.bugID)
- t.Logf("got : %q", bugID)
+ bugID, own := extractBugID(test.email, `"Foo Bar" <foo@bar.com>`)
+ if bugID != test.bugID || own != test.own {
+ t.Logf("expect: own=%v %q", test.own, test.bugID)
+ t.Logf("got : own=%v %q", test.own, bugID)
t.Fail()
}
})
@@ -89,18 +89,22 @@ line 2
var extractBugIDTests = []struct {
email string
bugID string
+ own bool
}{
{
`foo@bar.com`,
``,
+ true,
},
{
`foo+123@baz.com`,
``,
+ false,
},
{
`foo+123@bar.com`,
`123`,
+ true,
},
}