aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader/rss
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-04-07 13:56:11 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-04-07 13:56:11 -0700
commit702256bcc0e829b49a875e7c2b70c5078ff2c665 (patch)
tree5843c79caa3f235044246ee6502dd78257ca2075 /reader/rss
parent538d08c16ce72dcbb8c6d041bdf9643cf4a16763 (diff)
Add unit test for comments url and French translation
Diffstat (limited to 'reader/rss')
-rw-r--r--reader/rss/parser_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/reader/rss/parser_test.go b/reader/rss/parser_test.go
index 6d9015d..b75a8ff 100644
--- a/reader/rss/parser_test.go
+++ b/reader/rss/parser_test.go
@@ -581,6 +581,29 @@ func TestParseEntryWithRelativeURL(t *testing.T) {
}
}
+func TestParseEntryWithCommentsURL(t *testing.T) {
+ data := `<?xml version="1.0" encoding="utf-8"?>
+ <rss version="2.0">
+ <channel>
+ <link>https://example.org/</link>
+ <item>
+ <title>Item 1</title>
+ <link>https://example.org/item1</link>
+ <comments>https://example.org/comments</comments>
+ </item>
+ </channel>
+ </rss>`
+
+ feed, err := Parse(bytes.NewBufferString(data))
+ if err != nil {
+ t.Error(err)
+ }
+
+ if feed.Entries[0].CommentsURL != "https://example.org/comments" {
+ t.Errorf("Incorrect entry comments URL, got: %q", feed.Entries[0].CommentsURL)
+ }
+}
+
func TestParseInvalidXml(t *testing.T) {
data := `garbage`
_, err := Parse(bytes.NewBufferString(data))