(t *testing.T)
| 11 | chmctx "github.com/codehamr/codehamr/internal/ctx" |
| 12 | ) |
| 13 | |
| 14 | func TestReadFileHappy(t *testing.T) { |
| 15 | dir := t.TempDir() |
| 16 | path := filepath.Join(dir, "hello.txt") |
| 17 | content := "line one\nline two with 'quotes' and $dollar and `backticks`\n" |
| 18 | if err := os.WriteFile(path, []byte(content), 0o644); err != nil { |
| 19 | t.Fatal(err) |
| 20 | } |
| 21 | got := ReadFile(path, 0, 0) |
| 22 | if got != content { |
| 23 | t.Fatalf("read content mismatch:\n got %q\nwant %q", got, content) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestReadFileEmptyPath(t *testing.T) { |
nothing calls this directly
no test coverage detected