package output import ( "strings" "testing" ) func TestMarkdownToSpotifyHTML(t *testing.T) { in := `# Sermon Title **Speaker:** Pastor Bob **Scripture:** John 3:16 ## Overview This was a *short* message about hope. See [the site](https://example.com). ## Key Points - First point - Second point with **bold** text - Third one 1. Step one 2. Step two > A pithy quote. ` got := MarkdownToSpotifyHTML(in) mustContain := []string{ "
Sermon Title
", "Speaker:", "Overview
", "short", `the site`, "A pithy quote.
", } for _, s := range mustContain { if !strings.Contains(got, s) { t.Errorf("expected output to contain %q\n--- got ---\n%s", s, got) } } mustNotContain := []string{"", "**", "##"} for _, s := range mustNotContain { if strings.Contains(got, s) { t.Errorf("did not expect output to contain %q\n--- got ---\n%s", s, got) } } } func TestEscapesHTML(t *testing.T) { got := MarkdownToSpotifyHTML("A & ampersand") if strings.Contains(got, "