Skip to content

Commit

Permalink
Fixed feed title test for rss_2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderThaller committed Jul 23, 2013
1 parent 8d76ccc commit 60a94c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions rss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ func Test_ParseTitle(t *testing.T) {
m := map[string]string{
//"test1": "",
//"test2": "",
"rss_0.92": "Dave Winer: Grateful Dead",
"rss_1.0": "Golem.de",
//"rss_2.0": "RSS Title",
"rss_0.92": "Dave Winer: Grateful Dead",
"rss_1.0": "Golem.de",
"rss_2.0": "RSS Title",
"rss_2.0-1": "Liftoff News",
"atom_1.0": "Titel des Weblogs",
"atom_1.0-1": "Golem.de",
Expand All @@ -24,7 +24,11 @@ func Test_ParseTitle(t *testing.T) {
log.Print("Error when loading file ", k, ": ", e)
}
f, e := Parse(d)
o := f.Title

var o string
if e == nil {
o = f.Title
}

if o != v {
log.Print("KEY: ", k)
Expand Down
6 changes: 3 additions & 3 deletions testdata/rss_2.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<title>RSS Title</title>
<description>This is an example of an RSS feed</description>
<link>http://www.someexamplerssdomain.com/main.html</link>
<lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
<pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate>
<lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000</lastBuildDate>
<pubDate>Mon, 06 Sep 2009 16:45:00 +0000</pubDate>
<ttl>1800</ttl>

<item>
Expand All @@ -14,7 +14,7 @@
description.</description>
<link>http://www.wikipedia.org/</link>
<guid>unique string per item</guid>
<pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate>
<pubDate>Mon, 06 Sep 2009 16:45:00 +0000</pubDate>
</item>

</channel>
Expand Down

0 comments on commit 60a94c3

Please sign in to comment.