(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func 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 | |
| 60 | func TestHandleWrite_Validation(t *testing.T) { |
| 61 | e, _, _ := newWsEngine(t) |
nothing calls this directly
no test coverage detected