(t *testing.T)
| 107 | } |
| 108 | |
| 109 | func TestSpoolStdinToTemp_CleanupRemovesFile(t *testing.T) { |
| 110 | r := bytes.NewReader([]byte("data")) |
| 111 | |
| 112 | path, _, cleanup, err := spoolStdinToTemp(r) |
| 113 | if err != nil { |
| 114 | t.Fatalf("unexpected error: %v", err) |
| 115 | } |
| 116 | |
| 117 | if err := cleanup(); err != nil { |
| 118 | t.Fatalf("cleanup error: %v", err) |
| 119 | } |
| 120 | |
| 121 | if _, err := os.Stat(path); !os.IsNotExist(err) { |
| 122 | t.Errorf("expected temp file to be removed after cleanup, stat err = %v", err) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | type failingReader struct { |
| 127 | err error |
nothing calls this directly
no test coverage detected