html_meta_test.go 334 B

12345678910111213141516171819
  1. package httpgetter
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/require"
  5. )
  6. func TestGetHTMLMeta(t *testing.T) {
  7. tests := []struct {
  8. urlStr string
  9. htmlMeta HTMLMeta
  10. }{}
  11. for _, test := range tests {
  12. metadata, err := GetHTMLMeta(test.urlStr)
  13. require.NoError(t, err)
  14. require.Equal(t, test.htmlMeta, *metadata)
  15. }
  16. }