shitty-ssg/site/block_test.go

28 lines
438 B
Go
Raw Normal View History

2020-12-04 12:50:20 +01:00
package site
import (
"fmt"
"testing"
"git.sr.ht/~ewintr/go-kit/test"
)
func TestParagraph(t *testing.T) {
p := Paragraph([]InlineElement{
PlainText("one "),
PlainText("two "),
PlainText("three"),
})
exp := "<p>one two three</p>"
test.Equals(t, exp, p.BlockHTML())
}
func TestSubTitle(t *testing.T) {
text := "text"
st := SubTitle(text)
exp := fmt.Sprintf("<h2>%s</h2>", text)
test.Equals(t, exp, st.BlockHTML())
}