From ebabe267cda9c25d5789f647339d237893eed10e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 3 Jul 2017 18:24:39 +0200 Subject: pkg/email: don't add own email address to CC list Otherwise we we send each reply to ourselves and receive it again. --- pkg/email/parser_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/email/parser_test.go') 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" `) - if bugID != test.bugID { - t.Logf("expect: %q", test.bugID) - t.Logf("got : %q", bugID) + bugID, own := extractBugID(test.email, `"Foo Bar" `) + 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, }, } -- cgit mrf-deployment