package linkcheck import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestResolveMetaRedir(t *testing.T) { testDoc := []byte(` `) redir, err := resolveMetaRedirect(testDoc) require.NoError(t, err) assert.Equal(t, "https://github.com/Luzifer/twitch-bot", redir) testDoc = []byte(` `) redir, err = resolveMetaRedirect(testDoc) require.ErrorIs(t, err, errNoMetaRedir) assert.Equal(t, "", redir) }