Add unit test for comments url and French translation
This commit is contained in:
parent
538d08c16c
commit
702256bcc0
6 changed files with 32 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
// Code generated by go generate; DO NOT EDIT.
|
||||
// 2018-03-17 13:35:57.219730285 -0700 PDT m=+0.036714138
|
||||
// 2018-04-07 13:51:33.928362116 -0700 PDT m=+0.024804928
|
||||
|
||||
package locale
|
||||
|
||||
|
@ -455,7 +455,8 @@ var translations = map[string]string{
|
|||
"Invalid SSL certificate (original error: %q)": "Certificat SSL invalide (erreur originale : %q)",
|
||||
"This website is temporarily unreachable (original error: %q)": "Ce site web est temporairement injoignable (erreur originale : %q)",
|
||||
"This website is permanently unreachable (original error: %q)": "Ce site web n'est pas joignable de façon permanente (erreur originale : %q)",
|
||||
"Website unreachable, the request timed out after %d seconds": "Site web injoignable, la requête à échouée après %d secondes"
|
||||
"Website unreachable, the request timed out after %d seconds": "Site web injoignable, la requête à échouée après %d secondes",
|
||||
"Comments": "Commentaires"
|
||||
}
|
||||
`,
|
||||
"nl_NL": `{
|
||||
|
@ -1130,7 +1131,7 @@ var translations = map[string]string{
|
|||
var translationsChecksums = map[string]string{
|
||||
"de_DE": "af8315375e1801e06110b2efe1e4c74c26cabb2661682fc48be38afe30eb8617",
|
||||
"en_US": "6fe95384260941e8a5a3c695a655a932e0a8a6a572c1e45cb2b1ae8baa01b897",
|
||||
"fr_FR": "19db6e5ac678fe577e6c42789fe5322d71eee9ec0891d5f5998566adbb16c96d",
|
||||
"fr_FR": "b536114691935c5336de43e797ab30575e8168679e02cd462886f4d7fe5df2d2",
|
||||
"nl_NL": "d427d6a5e843be576040dee004df2b685a839a38b2e5f06435faa2973f1f4c70",
|
||||
"pl_PL": "4dcf7c3f44c80ca81ecdbef96bdb21d1ae1a8a6caf60cc11403e5e041efc5ca9",
|
||||
"zh_CN": "bfa05d3b3396df6222414a3a6949b73b486cd021499ecd3a34ce8e04e93aad93",
|
||||
|
|
|
@ -217,5 +217,6 @@
|
|||
"Invalid SSL certificate (original error: %q)": "Certificat SSL invalide (erreur originale : %q)",
|
||||
"This website is temporarily unreachable (original error: %q)": "Ce site web est temporairement injoignable (erreur originale : %q)",
|
||||
"This website is permanently unreachable (original error: %q)": "Ce site web n'est pas joignable de façon permanente (erreur originale : %q)",
|
||||
"Website unreachable, the request timed out after %d seconds": "Site web injoignable, la requête à échouée après %d secondes"
|
||||
"Website unreachable, the request timed out after %d seconds": "Site web injoignable, la requête à échouée après %d secondes",
|
||||
"Comments": "Commentaires"
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ type Entry struct {
|
|||
Hash string `json:"hash"`
|
||||
Title string `json:"title"`
|
||||
URL string `json:"url"`
|
||||
CommentsURL string `json:"comments"`
|
||||
CommentsURL string `json:"comments_url"`
|
||||
Date time.Time `json:"published_at"`
|
||||
Content string `json:"content"`
|
||||
Author string `json:"author"`
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by go generate; DO NOT EDIT.
|
||||
// 2018-04-06 23:04:38.601763638 +0100 BST m=+0.010102865
|
||||
// 2018-04-07 13:51:33.926223471 -0700 PDT m=+0.022666283
|
||||
|
||||
package template
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Code generated by go generate; DO NOT EDIT.
|
||||
// 2018-04-06 23:00:49.988275328 +0100 BST m=+0.007796083
|
||||
// 2018-04-07 13:51:33.918407222 -0700 PDT m=+0.014850034
|
||||
|
||||
package template
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue