Skip to content

Commit

Permalink
Merge 4104f44 into 77c492e
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcdole committed Apr 25, 2016
2 parents 77c492e + 4104f44 commit 05faed1
Show file tree
Hide file tree
Showing 593 changed files with 1,929 additions and 1,454 deletions.
2 changes: 1 addition & 1 deletion atom/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ type Source struct {
Contributors []*Person `json:"contributors,omitempty"`
Authors []*Person `json:"authors,omitempty"`
Categories []*Category `json:"categories,omitempty"`
Extensions ext.Extensions `json:"extensions"`
Extensions ext.Extensions `json:"extensions,omitempty"`
}
24 changes: 12 additions & 12 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ func TestParser_Parse(t *testing.T) {
feedTitle string
hasError bool
}{
{"atom03_feed.xml", "atom", "Atom Title", false},
{"atom10_feed.xml", "atom", "Atom Title", false},
{"rss_feed.xml", "rss", "RSS Title", false},
{"rdf_feed.xml", "rss", "RDF Title", false},
{"atom03_feed.xml", "atom", "Feed Title", false},
{"atom10_feed.xml", "atom", "Feed Title", false},
{"rss_feed.xml", "rss", "Feed Title", false},
{"rdf_feed.xml", "rss", "Feed Title", false},
{"unknown_feed.xml", "", "", true},
{"empty_feed.xml", "", "", true},
}
Expand Down Expand Up @@ -60,10 +60,10 @@ func TestParser_ParseString(t *testing.T) {
feedTitle string
hasError bool
}{
{"atom03_feed.xml", "atom", "Atom Title", false},
{"atom10_feed.xml", "atom", "Atom Title", false},
{"rss_feed.xml", "rss", "RSS Title", false},
{"rdf_feed.xml", "rss", "RDF Title", false},
{"atom03_feed.xml", "atom", "Feed Title", false},
{"atom10_feed.xml", "atom", "Feed Title", false},
{"rss_feed.xml", "rss", "Feed Title", false},
{"rdf_feed.xml", "rss", "Feed Title", false},
{"unknown_feed.xml", "", "", true},
{"empty_feed.xml", "", "", true},
}
Expand Down Expand Up @@ -98,10 +98,10 @@ func TestParser_ParseURL_Success(t *testing.T) {
feedTitle string
hasError bool
}{
{"atom03_feed.xml", "atom", "Atom Title", false},
{"atom10_feed.xml", "atom", "Atom Title", false},
{"rss_feed.xml", "rss", "RSS Title", false},
{"rdf_feed.xml", "rss", "RDF Title", false},
{"atom03_feed.xml", "atom", "Feed Title", false},
{"atom10_feed.xml", "atom", "Feed Title", false},
{"rss_feed.xml", "rss", "Feed Title", false},
{"rdf_feed.xml", "rss", "Feed Title", false},
{"unknown_feed.xml", "", "", true},
}

Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_author_email.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"authors": [
{
"email": "me@example.com"
"email": "email@example.org"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_author_homepage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"authors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
],
"entries": [],
Expand Down
9 changes: 9 additions & 0 deletions testdata/parser/atom/atom03_feed_author_mixed_content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"authors": [
{
"name": "Feed Author"
}
],
"entries": [],
"version": "0.3"
}
9 changes: 9 additions & 0 deletions testdata/parser/atom/atom03_feed_author_mixed_content.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--
Description: feed author - mixed content
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<author>
<name>Feed Author</name>
Mixed content
</author>
</feed>
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_author_name.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"authors": [
{
"name": "Example author"
"name": "Feed Author"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_author_uri.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"authors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_author_url.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"authors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_contributor_email.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"contributors": [
{
"email": "me@example.com"
"email": "email@example.org"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_contributor_homepage.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"contributors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
],
"entries": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"contributors": [
{
"name": "Feed Contributor"
}
],
"entries": [],
"version": "0.3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--
Description: feed contributor - mixed content
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<contributor>
<name>Feed Contributor</name>
Mixed content
</contributor>
</feed>
12 changes: 6 additions & 6 deletions testdata/parser/atom/atom03_feed_contributor_multiple.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"contributors": [
{
"name": "Contributor 1",
"email": "me@example.com",
"uri": "http://example.com/"
"name": "Contributor Name 1",
"email": "email@example.org",
"uri": "http://example.org/"
},
{
"name": "Contributor 2",
"email": "you@example.com",
"uri": "http://two.example.com/"
"name": "Contributor Name 2",
"email": "email2@example.org",
"uri": "http://two.example.org/"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_contributor_name.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"contributors": [
{
"name": "Example contributor"
"name": "Feed Contributor"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_contributor_uri.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"contributors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_contributor_url.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"contributors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
],
"entries": [],
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_copyright.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rights": "Example Atom",
"rights": "Feed Rights",
"entries": [],
"version": "0.3"
}
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_copyright_base64.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rights": "Example <b>Atom</b>",
"rights": "Feed <b>Rights</b>",
"entries": [],
"version": "0.3"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rights": "Example <b>Atom</b>",
"rights": "Feed <b>Rights</b>",
"entries": [],
"version": "0.3"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rights": "Example <b>Atom</b>",
"rights": "Feed <b>Rights</b>",
"entries": [],
"version": "0.3"
}
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_copyright_text.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rights": "Example Atom",
"rights": "Feed Rights",
"entries": [],
"version": "0.3"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"rights": "Example <b>Atom</b>",
"rights": "Feed <b>Rights</b>",
"entries": [],
"version": "0.3"
}
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_entry_author_email.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"authors": [
{
"email": "me@example.com"
"email": "email@example.org"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"authors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
]
}
Expand Down
12 changes: 12 additions & 0 deletions testdata/parser/atom/atom03_feed_entry_author_mixed_content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entries": [
{
"authors": [
{
"name": "Author Name"
}
]
}
],
"version": "0.3"
}
11 changes: 11 additions & 0 deletions testdata/parser/atom/atom03_feed_entry_author_mixed_content.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
Description: entry author - mixed content
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<entry>
<author>
<name>Author Name</name>
Mixed content
</author>
</entry>
</feed>
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_entry_author_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"authors": [
{
"name": "Example author"
"name": "Author Name"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_entry_author_uri.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"authors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_entry_author_url.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"authors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/parser/atom/atom03_feed_entry_content.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"entries": [
{
"content": {
"value": "Example Atom"
"value": "Entry Content"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"contributors": [
{
"email": "me@example.com"
"email": "email@example.org"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"contributors": [
{
"uri": "http://example.com/"
"uri": "http://example.org/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entries": [
{
"contributors": [
{
"name": "Contributor Name"
}
]
}
],
"version": "0.3"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
Description: entry contributor - mixed content
-->
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<entry>
<contributor>
<name>Contributor Name</name>
Mixed content
</contributor>
</entry>
</feed>
12 changes: 6 additions & 6 deletions testdata/parser/atom/atom03_feed_entry_contributor_multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
{
"contributors": [
{
"name": "Contributor 1",
"email": "me@example.com",
"uri": "http://example.com/"
"name": "Contributor Name 1",
"email": "email@example.org",
"uri": "http://example.org/"
},
{
"name": "Contributor 2",
"email": "you@example.com",
"uri": "http://two.example.com/"
"name": "Contributor Name 2",
"email": "email2@example.org",
"uri": "http://two.example.org/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"contributors": [
{
"name": "Example contributor"
"name": "Contributor Name"
}
]
}
Expand Down
Loading

0 comments on commit 05faed1

Please sign in to comment.