goparsify/html/html_test.go
2017-08-06 17:02:39 +10:00

18 lines
410 B
Go

package html
import (
"testing"
"github.com/stretchr/testify/require"
. "github.com/vektah/goparsify"
)
func TestParse(t *testing.T) {
result, _, err := Parse("<body>hello <b>world</b></body>")
require.NoError(t, err)
require.Equal(t, Tag{Name: "body", Attributes: map[string]string{}, Body: []Node{
"hello ",
Tag{Name: "b", Attributes: map[string]string{}, Body: []Node{"world"}},
}}, result)
}