MCPcopy
hub / github.com/cloudflare/tableflip / TestFdsFile

Function TestFdsFile

fds_test.go:295–317  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

293}
294
295func TestFdsFile(t *testing.T) {
296 r, w, err := os.Pipe()
297 if err != nil {
298 t.Fatal(err)
299 }
300 defer r.Close()
301
302 parent := newFds(nil, nil)
303 if err := parent.AddFile("test", w); err != nil {
304 t.Fatal("Can't add file:", err)
305 }
306 w.Close()
307
308 child := newFds(parent.copy(), nil)
309 file, err := child.File("test")
310 if err != nil {
311 t.Fatal("Can't get file:", err)
312 }
313 if file == nil {
314 t.Fatal("Missing file")
315 }
316 file.Close()
317}
318
319func TestFdsFiles(t *testing.T) {
320 r1, w1, err := os.Pipe()

Callers

nothing calls this directly

Calls 4

newFdsFunction · 0.85
copyMethod · 0.80
AddFileMethod · 0.45
FileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…