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

Function TestHandleWrite_Append

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

Source from the content-addressed store, hash-verified

42}
43
44func TestHandleWrite_Append(t *testing.T) {
45 e, _, root := newWsEngine(t)
46 target := filepath.Join(root, "f.txt")
47 if err := os.WriteFile(target, []byte("a"), 0600); err != nil {
48 t.Fatal(err)
49 }
50 if err := e.Execute(context.Background(), "write",
51 []string{"--file", target, "--content", "b", "--append"}); err != nil {
52 t.Fatalf("write append: %v", err)
53 }
54 got, _ := os.ReadFile(target)
55 if string(got) != "ab" {
56 t.Errorf("append content=%q want ab", got)
57 }
58}
59
60func TestHandleWrite_Validation(t *testing.T) {
61 e, _, _ := newWsEngine(t)

Callers

nothing calls this directly

Calls 3

newWsEngineFunction · 0.85
ErrorfMethod · 0.80
ExecuteMethod · 0.65

Tested by

no test coverage detected