package nip54 import ( "strings" "testing" ) func TestArticleAsHTML(t *testing.T) { tests := []struct { name string input string contains []string }{ { name: "simple paragraph", input: "Hello world", contains: []string{"

", "Hello world", "

"}, }, { name: "emphasis", input: "*Hello* _world_", contains: []string{"", "Hello", "", "", "world", ""}, }, { name: "heading", input: "# Title", contains: []string{"

", "Title", "

"}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { result := ArticleAsHTML(tt.input) for _, expected := range tt.contains { if !strings.Contains(result, expected) { t.Errorf("ArticleAsHTML() output does not contain %q\nGot: %s", expected, result) } } }) } }