INNER CODE UNIT · Go
TestCollapse_StartWithCode
JohannesKaufmann/html-to-markdown · collapse/collapse_test.go:41
func TestCollapse_StartWithCode(t *testing.T) {
textNode := &html.Node{
Type: html.TextNode,
Data: " text ",
}
codeNode := &html.Node{
Type: html.ElementNode,
Data: "code",
}
codeNode.AppendChild(textNode)
Collapse(codeNode, nil)
tester.ExpectRepresentation(t, codeNode, "after", `
code
├─#text " text "
`)
}