From a9b61f84070cc7ca0d6e26f187c745619a91422a Mon Sep 17 00:00:00 2001 From: Philipp Tanlak Date: Thu, 27 Jul 2023 19:03:41 +0200 Subject: init --- scrape/query_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scrape/query_test.go (limited to 'scrape/query_test.go') diff --git a/scrape/query_test.go b/scrape/query_test.go new file mode 100644 index 0000000..0e8423d --- /dev/null +++ b/scrape/query_test.go @@ -0,0 +1,23 @@ +package scrape + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestQuery(t *testing.T) { + html := ` + +

Page Title

+
+
First post
+
Second post
+
Third post
+
+ +` + + title := Query(Doc(html), "#title") + require.Equal(t, title, "Page Title") +} -- cgit v1.2.3