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

Function assertParseSingleFile

pkg/gitdiff/format_roundtrip_test.go:59–68  ·  view source on GitHub ↗
(t *testing.T, b []byte, kind string)

Source from the content-addressed store, hash-verified

57}
58
59func assertParseSingleFile(t *testing.T, b []byte, kind string) *File {
60 files, _, err := Parse(bytes.NewReader(b))
61 if err != nil {
62 t.Fatalf("failed to parse %s: %v", kind, err)
63 }
64 if len(files) != 1 {
65 t.Fatalf("expected %s to contain a single files, but found %d", kind, len(files))
66 }
67 return files[0]
68}
69
70func assertFilesEqual(t *testing.T, expected, actual *File) {
71 assertEqual(t, expected.OldName, actual.OldName, "OldName")

Callers 1

TestFormatRoundtripFunction · 0.85

Calls 1

ParseFunction · 0.85

Tested by

no test coverage detected