diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-10-11 13:37:44 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-10-11 19:47:32 +0200 |
| commit | c3772ff106ecd84b205a4c5796122d45392d28f4 (patch) | |
| tree | edf4b281b2b6a2a7c6521e689fb6636804b071e7 /pkg/vcs/git_test.go | |
| parent | 0e1a45faf725044d6686a0b91ced05df0abb2d8b (diff) | |
pkg/email, pkg/vcs: test that OpenBSD-style commits are handled
OpenBSD does not use "first line is title" convention,
so test that this is parsed properly.
Also test that multi-line fix/dup commands are properly parsed.
Diffstat (limited to 'pkg/vcs/git_test.go')
| -rw-r--r-- | pkg/vcs/git_test.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pkg/vcs/git_test.go b/pkg/vcs/git_test.go index 6fae1c475..7c0f32a30 100644 --- a/pkg/vcs/git_test.go +++ b/pkg/vcs/git_test.go @@ -8,6 +8,8 @@ import ( "strings" "testing" "time" + + "github.com/google/go-cmp/cmp" ) func TestGitParseCommit(t *testing.T) { @@ -124,8 +126,8 @@ func TestGitExtractFixTags(t *testing.T) { if err != nil { t.Fatal(err) } - if !reflect.DeepEqual(commits, extractFixTagsOutput) { - t.Fatalf("got : %+v\twant: %+v", commits, extractFixTagsOutput) + if diff := cmp.Diff(extractFixTagsOutput, commits); diff != "" { + t.Fatal(diff) } } @@ -136,6 +138,7 @@ var extractFixTagsOutput = []FixCommit{ {"8e4090902540da8c6e8f", "executor: remove dead code"}, {"a640a0fc325c29c3efcb", "executor: remove dead code"}, {"8e4090902540da8c6e8fa640a0fc325c29c3efcb", "pkg/csource: fix string escaping bug"}, + {"6dd701dc797b23b8c761", "When freeing a lockf struct that already is part of a linked list, make sure to"}, } var extractFixTagsInput = ` @@ -163,4 +166,14 @@ Date: Fri Dec 22 11:59:09 2017 +0100 pkg/csource: fix string escaping bug Reported-and-tested-by: syzbot+8e4090902540da8c6e8fa640a0fc325c29c3efcb@my.mail.com + +commit 47546510aa98d3fbff3291a5dc3cefe712e70394 +Author: anton <openbsd@openbsd.org> +Date: Sat Oct 6 21:12:23 2018 +0000 + + When freeing a lockf struct that already is part of a linked list, make sure to + update the next pointer for the preceding lock. Prevents a double free panic. + + ok millert@ + Reported-by: syzbot+6dd701dc797b23b8c761@my.mail.com ` |
