(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestReadStdin(t *testing.T) { |
| 28 | input := "test input" |
| 29 | stdin := io.NopCloser(strings.NewReader(input)) |
| 30 | // No need to cast stdin to *os.File, pass it as io.ReadCloser directly |
| 31 | content, err := ReadStdin(stdin) |
| 32 | if err != nil { |
| 33 | t.Fatalf("unexpected error: %v", err) |
| 34 | } |
| 35 | if content != input { |
| 36 | t.Fatalf("expected %q, got %q", input, content) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // ReadStdin function assuming it's part of `cli` package |
| 41 | func ReadStdin(reader io.ReadCloser) (string, error) { |
nothing calls this directly
no test coverage detected