(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestResolveInputFlags_File(t *testing.T) { |
| 61 | dir := t.TempDir() |
| 62 | cmdutil.TestChdir(t, dir) |
| 63 | |
| 64 | content := "## Hello\n\nThis is **markdown** from a file.\n" |
| 65 | if err := os.WriteFile("test.md", []byte(content), 0644); err != nil { |
| 66 | t.Fatal(err) |
| 67 | } |
| 68 | |
| 69 | rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "@test.md"}, "") |
| 70 | flags := []Flag{{Name: "markdown", Input: []string{File, Stdin}}} |
| 71 | |
| 72 | if err := resolveInputFlags(rctx, flags); err != nil { |
| 73 | t.Fatalf("unexpected error: %v", err) |
| 74 | } |
| 75 | if got := rctx.Str("markdown"); got != content { |
| 76 | t.Errorf("expected %q, got %q", content, got) |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func TestResolveInputFlags_EmptyFile(t *testing.T) { |
| 81 | dir := t.TempDir() |
nothing calls this directly
no test coverage detected