MCPcopy Create free account
hub / github.com/antonmedv/gitmal / assertPatchIdentity

Function assertPatchIdentity

pkg/gitdiff/patch_header_test.go:454–464  ·  view source on GitHub ↗
(t *testing.T, kind string, exp, act *PatchIdentity)

Source from the content-addressed store, hash-verified

452}
453
454func assertPatchIdentity(t *testing.T, kind string, exp, act *PatchIdentity) {
455 switch {
456 case exp == nil && act == nil:
457 case exp == nil && act != nil:
458 t.Errorf("incorrect parsed %s: expected nil, but got %+v", kind, act)
459 case exp != nil && act == nil:
460 t.Errorf("incorrect parsed %s: expected %+v, but got nil", kind, exp)
461 case exp.Name != act.Name || exp.Email != act.Email:
462 t.Errorf("incorrect parsed %s, expected %+v, bot got %+v", kind, exp, act)
463 }
464}
465
466func TestCleanSubject(t *testing.T) {
467 expectedSubject := "A sample commit to test header parsing"

Callers 1

TestParsePatchHeaderFunction · 0.85

Calls 1

ErrorfMethod · 0.80

Tested by

no test coverage detected