package main import ( "strings" "testing" ) func TestRenderMarkdown(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
"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result := renderMarkdown(tt.input)
if !strings.Contains(result, tt.contains) {
t.Errorf("renderMarkdown(%q) = %q, want to contain %q", tt.input, result, tt.contains)
}
})
}
}