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

Function TestHandleWrite_Basic

pkg/coder/engine/commands_fs_test.go:27–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestHandleWrite_Basic(t *testing.T) {
28 e, out, root := newWsEngine(t)
29 target := filepath.Join(root, "sub", "f.txt")
30
31 if err := e.Execute(context.Background(), "write",
32 []string{"--file", target, "--content", "hello"}); err != nil {
33 t.Fatalf("write: %v", err)
34 }
35 got, err := os.ReadFile(target)
36 if err != nil || string(got) != "hello" {
37 t.Fatalf("content=%q err=%v", got, err)
38 }
39 if !strings.Contains(out.String(), "escrito") {
40 t.Errorf("missing success message: %q", out.String())
41 }
42}
43
44func TestHandleWrite_Append(t *testing.T) {
45 e, _, root := newWsEngine(t)

Callers

nothing calls this directly

Calls 4

newWsEngineFunction · 0.85
ErrorfMethod · 0.80
ExecuteMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected