mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-28 16:56:26 +00:00
join functions
This commit is contained in:
parent
8353845a8c
commit
8ec7df333c
12
main_test.go
12
main_test.go
@ -31,22 +31,16 @@ func requireNoErr(t *testing.T, err error, msg string) {
|
||||
}
|
||||
}
|
||||
|
||||
func getReadmeHTML(t *testing.T) []byte {
|
||||
func goqueryFromReadme(t *testing.T) *goquery.Document {
|
||||
t.Helper()
|
||||
|
||||
input, err := os.ReadFile(readmePath + "asdasd")
|
||||
input, err := os.ReadFile(readmePath)
|
||||
requireNoErr(t, err, "readme file should be exists")
|
||||
|
||||
html, err := markdown.ToHTML(input)
|
||||
requireNoErr(t, err, "markdown should be rendered to html")
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
func goqueryFromReadme(t *testing.T) *goquery.Document {
|
||||
t.Helper()
|
||||
|
||||
buf := bytes.NewBuffer(getReadmeHTML(t))
|
||||
buf := bytes.NewBuffer(html)
|
||||
doc, err := goquery.NewDocumentFromReader(buf)
|
||||
requireNoErr(t, err, "html must be valid for goquery")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user