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

Method Load

pkg/gitdiff/apply_test.go:216–235  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

214}
215
216func (f applyFiles) Load(t *testing.T) (src []byte, patch []byte, out []byte) {
217 load := func(name, kind string) []byte {
218 d, err := ioutil.ReadFile(filepath.Join("testdata", "apply", name))
219 if err != nil {
220 t.Fatalf("failed to read %s file: %v", kind, err)
221 }
222 return d
223 }
224
225 if f.Src != "" {
226 src = load(f.Src, "source")
227 }
228 if f.Patch != "" {
229 patch = load(f.Patch, "patch")
230 }
231 if f.Out != "" {
232 out = load(f.Out, "output")
233 }
234 return
235}

Callers 1

runMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected