MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestReadFileHappy

Function TestReadFileHappy

internal/tools/read_test.go:13–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11 chmctx "github.com/codehamr/codehamr/internal/ctx"
12)
13
14func 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
27func TestReadFileEmptyPath(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ReadFileFunction · 0.85

Tested by

no test coverage detected