blob: f614b4d4008fc18335a1dedf297451fc4b1f6676 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
package html
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestParse(t *testing.T) {
result, err := Parse(`<body>hello <p color="blue">world</p></body>`)
require.NoError(t, err)
require.Equal(t, Tag{Name: "body", Attributes: map[string]string{}, Body: []interface{}{
"hello ",
Tag{Name: "p", Attributes: map[string]string{"color": "blue"}, Body: []interface{}{"world"}},
}}, result)
}
|