summaryrefslogtreecommitdiff
path: root/html/html_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'html/html_test.go')
-rw-r--r--html/html_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/html/html_test.go b/html/html_test.go
new file mode 100644
index 0000000..6dca6d4
--- /dev/null
+++ b/html/html_test.go
@@ -0,0 +1,17 @@
+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)
+}