package main import ( "strings" "testing" ) func TestRenderMD(t *testing.T) { tests := []struct { name string input string contains string }{ {"plain text", "Hello world", "
Hello world
"}, {"bold", "**bold**", "bold"}, {"code block", "```\ncode\n```", "code"},
{"inline code", "`inline`", "inline"},
{"heading", "# Title", "Title
"},
{"table", "| A | B |\n|---|---|\n| 1 | 2 |", ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := RenderMD(tt.input)
if !strings.Contains(result, tt.contains) {
t.Errorf("RenderMD(%q) = %q, want to contain %q", tt.input, result, tt.contains)
}
})
}
}