From a65a9325aaebd1499a8e523463cc023124f8536a Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Sun, 6 Aug 2017 17:02:39 +1000 Subject: Get the HTML parser working --- html/html_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 html/html_test.go (limited to 'html/html_test.go') 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("hello world") + 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) +} -- cgit v1.2.3