(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func 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 | |
| 44 | func TestHandleWrite_Append(t *testing.T) { |
| 45 | e, _, root := newWsEngine(t) |
nothing calls this directly
no test coverage detected