diff options
author | 2023-12-01 16:27:18 -0800 | |
---|---|---|
committer | 2023-12-01 16:52:03 -0800 | |
commit | d0f99cee1af46be932b3b6b7e343a511eaa829a1 (patch) | |
tree | c9af07ac29e666adef0e5ff68d01f362bfaead61 /internal/reader/subscription/finder_test.go | |
parent | f8b40085cdc4af0ce8f36c54b5e16b700acedf65 (diff) | |
download | v2-d0f99cee1af46be932b3b6b7e343a511eaa829a1.tar.gz v2-d0f99cee1af46be932b3b6b7e343a511eaa829a1.tar.zst v2-d0f99cee1af46be932b3b6b7e343a511eaa829a1.zip |
Regression: ensure all HTML documents are encoded in UTF-8
Fixes #2196
Diffstat (limited to 'internal/reader/subscription/finder_test.go')
-rw-r--r-- | internal/reader/subscription/finder_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/reader/subscription/finder_test.go b/internal/reader/subscription/finder_test.go index 71f49281..160b52cb 100644 --- a/internal/reader/subscription/finder_test.go +++ b/internal/reader/subscription/finder_test.go @@ -40,7 +40,7 @@ func TestParseWebPageWithRssFeed(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -73,7 +73,7 @@ func TestParseWebPageWithAtomFeed(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -106,7 +106,7 @@ func TestParseWebPageWithJSONFeed(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -139,7 +139,7 @@ func TestParseWebPageWithOldJSONFeedMimeType(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -172,7 +172,7 @@ func TestParseWebPageWithRelativeFeedURL(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -205,7 +205,7 @@ func TestParseWebPageWithEmptyTitle(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -239,7 +239,7 @@ func TestParseWebPageWithMultipleFeeds(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -261,7 +261,7 @@ func TestParseWebPageWithDuplicatedFeeds(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -294,7 +294,7 @@ func TestParseWebPageWithEmptyFeedURL(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } @@ -315,7 +315,7 @@ func TestParseWebPageWithNoHref(t *testing.T) { </body> </html>` - subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", strings.NewReader(htmlPage)) + subscriptions, err := NewSubscriptionFinder(nil).FindSubscriptionsFromWebPage("http://example.org/", "text/html", strings.NewReader(htmlPage)) if err != nil { t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err) } |