diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-12-05 13:55:41 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-12-05 14:43:35 +0100 |
| commit | 64eb5abeff73f290c3b76aa97c6acd7ed627fa2d (patch) | |
| tree | e2bf2339b133543a2950fcc2eb0e9c25904bd3d5 /pkg/email/patch_test.go | |
| parent | dff7de3a521bb4e0538796e8c96e380270f5bfc9 (diff) | |
pkg/email: refactor ParsePatch
Currently the function returns the values that are not being used
anywhere. Refactor it.
Diffstat (limited to 'pkg/email/patch_test.go')
| -rw-r--r-- | pkg/email/patch_test.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pkg/email/patch_test.go b/pkg/email/patch_test.go index 0919db9ca..a2be0d6c9 100644 --- a/pkg/email/patch_test.go +++ b/pkg/email/patch_test.go @@ -10,13 +10,7 @@ import ( func TestParsePatch(t *testing.T) { for _, test := range tests { t.Run(test.title, func(t *testing.T) { - title, diff, err := ParsePatch(test.text) - if err != nil { - t.Fatalf("failed to parse patch: %v", err) - } - if test.title != title { - t.Fatalf("title mismatch, want:\n%v\ngot:\n%v", test.title, title) - } + diff := ParsePatch([]byte(test.text)) if test.diff != diff { t.Fatalf("diff mismatch, want:\n%v\ngot:\n%v", test.diff, diff) } @@ -478,4 +472,14 @@ Index: usb-devel/drivers/usb/core/hub.c dev_err(hub->intfdev, "activate --> %d\n", status); `, }, + { + text: `Some +Text +Without +Any +Diff +`, + diff: "", + title: "test empty patch", + }, } |
