diff options
author | Frédéric Guillot <fred@miniflux.net> | 2017-12-13 20:16:15 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2017-12-13 20:16:15 -0800 |
commit | 827683ab59131ec38ed7cfa268bcaa6dc77d1412 (patch) | |
tree | 8461fa67142378b050fde4ee39d393e18ab71aaf /reader/rss/parser_test.go | |
parent | 84d912c9794eaaef0f06638d9d23716f4e02b42f (diff) |
Make sure that item URL are absolute
Diffstat (limited to 'reader/rss/parser_test.go')
-rw-r--r-- | reader/rss/parser_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/reader/rss/parser_test.go b/reader/rss/parser_test.go index 982d4f0..7d72417 100644 --- a/reader/rss/parser_test.go +++ b/reader/rss/parser_test.go @@ -537,6 +537,27 @@ func TestParseEntryWithFeedBurnerEnclosures(t *testing.T) { } } +func TestParseEntryWithRelativeURL(t *testing.T) { + data := `<?xml version="1.0" encoding="utf-8"?> + <rss version="2.0"> + <channel> + <link>https://example.org/</link> + <item> + <link>item.html</link> + </item> + </channel> + </rss>` + + feed, err := Parse(bytes.NewBufferString(data)) + if err != nil { + t.Error(err) + } + + if feed.Entries[0].Title != "https://example.org/item.html" { + t.Errorf("Incorrect entry title, got: %s", feed.Entries[0].Title) + } +} + func TestParseInvalidXml(t *testing.T) { data := `garbage` _, err := Parse(bytes.NewBufferString(data)) |