From af74e39fa73c7b4d18b148d00f942f5c088d44cf Mon Sep 17 00:00:00 2001 From: fred Date: Mon, 19 Jun 2023 15:02:07 -0700 Subject: [PATCH] Add test case to parse Atom icon URL --- reader/atom/atom_10_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/reader/atom/atom_10_test.go b/reader/atom/atom_10_test.go index 42166ca4..632fde9e 100644 --- a/reader/atom/atom_10_test.go +++ b/reader/atom/atom_10_test.go @@ -48,6 +48,10 @@ func TestParseAtomSample(t *testing.T) { t.Errorf("Incorrect site URL, got: %s", feed.SiteURL) } + if feed.IconURL != "" { + t.Errorf("Incorrect icon URL, got: %s", feed.IconURL) + } + if len(feed.Entries) != 1 { t.Errorf("Incorrect number of entries, got: %d", len(feed.Entries)) } @@ -1648,3 +1652,21 @@ func TestParseFeedWithCategories(t *testing.T) { t.Errorf("Incorrect entry category, got %q instead of %q", result, expected) } } + +func TestParseFeedWithIconURL(t *testing.T) { + data := ` + + Example Feed + + http://example.org/icon.png + ` + + feed, err := Parse("https://example.org/", bytes.NewBufferString(data)) + if err != nil { + t.Fatal(err) + } + + if feed.IconURL != "http://example.org/icon.png" { + t.Errorf("Incorrect icon URL, got: %s", feed.IconURL) + } +}