2022-11-19 13:43:56 +03:00
|
|
|
package getter
|
2022-11-19 11:58:55 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2022-11-19 13:43:56 +03:00
|
|
|
func TestGetHTMLMeta(t *testing.T) {
|
2022-11-19 11:58:55 +03:00
|
|
|
tests := []struct {
|
2022-11-19 13:43:56 +03:00
|
|
|
urlStr string
|
2022-11-19 11:58:55 +03:00
|
|
|
htmlMeta HTMLMeta
|
2023-04-02 04:28:02 +03:00
|
|
|
}{}
|
2022-11-19 11:58:55 +03:00
|
|
|
for _, test := range tests {
|
2022-11-19 13:43:56 +03:00
|
|
|
metadata, err := GetHTMLMeta(test.urlStr)
|
2022-11-19 11:58:55 +03:00
|
|
|
require.NoError(t, err)
|
|
|
|
require.Equal(t, test.htmlMeta, *metadata)
|
|
|
|
}
|
|
|
|
}
|