package site_test import ( "testing" "ewintr.nl/go-kit/test" "ewintr.nl/shitty-ssg/cmd/ssg/site" "ewintr.nl/shitty-ssg/pkg/adoc" ) func TestFormatBlock(t *testing.T) { for _, tc := range []struct { name string element adoc.BlockElement exp string }{ { name: "paragraph", element: adoc.Paragraph{ adoc.PlainText("one"), adoc.PlainText("two"), adoc.PlainText("three"), }, exp: "
onetwothree
", }, { name: "subtitle", element: adoc.SubTitle("text"), exp: `text
",
},
{
name: "list",
element: adoc.List{
{adoc.PlainText("one")},
{adoc.PlainText("two")},
{adoc.PlainText("three")},
},
exp: "text
",
},
} {
t.Run(tc.name, func(t *testing.T) {
test.Equals(t, tc.exp, site.FormatInline(tc.element))
})
}
}