Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Side by Side Diff: go/util/util_test.go

Issue 1849283002: AutoRolls include Chromium bug links (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: ... Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« go/util/util.go ('K') | « go/util/util.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 package util 1 package util
2 2
3 import ( 3 import (
4 "bytes" 4 "bytes"
5 "io" 5 "io"
6 "regexp" 6 "regexp"
7 "testing" 7 "testing"
8 "time" 8 "time"
9 9
10 assert "github.com/stretchr/testify/require" 10 assert "github.com/stretchr/testify/require"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 h_3, err := MD5Params(m_3) 299 h_3, err := MD5Params(m_3)
300 assert.Nil(t, err) 300 assert.Nil(t, err)
301 assert.Equal(t, 32, len(h_1)) 301 assert.Equal(t, 32, len(h_1))
302 assert.Equal(t, 32, len(h_2)) 302 assert.Equal(t, 32, len(h_2))
303 assert.Equal(t, 32, len(h_3)) 303 assert.Equal(t, 32, len(h_3))
304 assert.NotEqual(t, h_1, h_2) 304 assert.NotEqual(t, h_1, h_2)
305 assert.NotEqual(t, h_1, h_3) 305 assert.NotEqual(t, h_1, h_3)
306 assert.Equal(t, h_2, h_3) 306 assert.Equal(t, h_2, h_3)
307 } 307 }
308
309 func TestBugsFromCommitMsg(t *testing.T) {
310 cases := []struct {
311 in string
312 out map[string][]string
313 }{
314 {
315 in: "BUG=skia:1234",
316 out: map[string][]string{
317 "skia": []string{"1234"},
318 },
319 },
320 {
321 in: "BUG=skia:1234,skia:4567",
322 out: map[string][]string{
323 "skia": []string{"1234", "4567"},
324 },
325 },
326 {
327 in: "BUG=skia:1234,skia:4567,skia:8901",
328 out: map[string][]string{
329 "skia": []string{"1234", "4567", "8901"},
330 },
331 },
332 {
333 in: "BUG=1234",
334 out: map[string][]string{
335 "chromium": []string{"1234"},
336 },
337 },
338 {
339 in: "BUG=skia:1234, 456",
340 out: map[string][]string{
341 "chromium": []string{"456"},
342 "skia": []string{"1234"},
343 },
344 },
345 {
346 in: `Lorem ipsum dolor sit amet, consectetur adipiscing elit.
347
348 Quisque feugiat, mi et tristique dignissim, sapien risus tristique mi, non digni ssim nibh erat ut ex.
349
350 BUG=1234, skia:5678
351 `,
352 out: map[string][]string{
353 "chromium": []string{"1234"},
354 "skia": []string{"5678"},
355 },
356 },
357 }
358 for _, tc := range cases {
359 result := BugsFromCommitMsg(tc.in)
360 assert.Equal(t, tc.out, result)
361 }
362 }
OLDNEW
« go/util/util.go ('K') | « go/util/util.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698