Skip to content

Commit

Permalink
added test for `GetHTMLCode
Browse files Browse the repository at this point in the history
  • Loading branch information
kinoute committed Oct 18, 2021
1 parent f6ea4e3 commit e6778ab
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions utils/testing_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package utils

import (
"testing"
)

func TestGetHTMLCode(t *testing.T) {
cases := []struct {
in string
}{
{"https://defret.in"},
{"https://github.com"},
{"https://whattheshot.com"},
{"https://whatthemovie.com"},
}

for _, c := range cases {
got := GetHTMLCode(c.in)
title := got.Find("title").Text()
if title == "" {
t.Errorf("getHTMLCode(%q) == null, expected not empty", c.in)
}
}
}

0 comments on commit e6778ab

Please sign in to comment.