MCPcopy Create free account
hub / github.com/driangle/taskmd / TestWriteYAML

Function TestWriteYAML

apps/cli/internal/cli/format_test.go:35–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestWriteYAML(t *testing.T) {
36 var buf bytes.Buffer
37 data := map[string]string{"key": "value"}
38
39 if err := WriteYAML(&buf, data); err != nil {
40 t.Fatalf("WriteYAML failed: %v", err)
41 }
42
43 // Verify it's valid YAML
44 var parsed map[string]string
45 if err := yaml.Unmarshal(buf.Bytes(), &parsed); err != nil {
46 t.Fatalf("output is not valid YAML: %v", err)
47 }
48 if parsed["key"] != "value" {
49 t.Errorf("expected key=value, got key=%s", parsed["key"])
50 }
51}
52
53func TestValidateFormat(t *testing.T) {
54 tests := []struct {

Callers

nothing calls this directly

Calls 1

WriteYAMLFunction · 0.85

Tested by

no test coverage detected