summaryrefslogtreecommitdiff
path: root/html/html_test.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-06 17:02:39 +1000
committerAdam Scarr <adam@vektah.net>2017-08-06 17:02:39 +1000
commita65a9325aaebd1499a8e523463cc023124f8536a (patch)
tree2fb31800b67a3914a7204a28319a7aeb0ac649c7 /html/html_test.go
parent8b343d6360d0edc065b9b62ab5e708e907b45a92 (diff)
Get the HTML parser working
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)
+}