(t *testing.T)
| 214 | } |
| 215 | |
| 216 | func (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 | } |