MCPcopy Create free account
hub / github.com/diillson/chatcli / writeTestFile

Function writeTestFile

operator/controllers/source_controller_test.go:29–37  ·  view source on GitHub ↗

--- readLinesAround ---

(t *testing.T, path, content string)

Source from the content-addressed store, hash-verified

27// --- readLinesAround ---
28
29func writeTestFile(t *testing.T, path, content string) {
30 t.Helper()
31 if err := os.MkdirAll(filepath.Dir(path), 0o750); err != nil {
32 t.Fatalf("mkdir %s: %v", filepath.Dir(path), err)
33 }
34 if err := os.WriteFile(path, []byte(content), 0o600); err != nil {
35 t.Fatalf("write %s: %v", path, err)
36 }
37}
38
39func TestReadLinesAround_HappyPath(t *testing.T) {
40 root := t.TempDir()

Calls 1

DirMethod · 0.45

Tested by

no test coverage detected