1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-06-27 16:36:00 +00:00

Add support for Atom 0.3

This commit is contained in:
Frédéric Guillot 2019-12-22 22:18:21 -08:00
parent cfb6ddfcea
commit 33fdb2c489
9 changed files with 1519 additions and 1018 deletions

View file

@ -26,7 +26,7 @@ func TestDetectRSS(t *testing.T) {
}
}
func TestDetectAtom(t *testing.T) {
func TestDetectAtom10(t *testing.T) {
data := `<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"></feed>`
format := DetectFeedFormat(data)
@ -35,6 +35,15 @@ func TestDetectAtom(t *testing.T) {
}
}
func TestDetectAtom03(t *testing.T) {
data := `<?xml version="1.0" encoding="utf-8"?><feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en"></feed>`
format := DetectFeedFormat(data)
if format != FormatAtom {
t.Errorf(`Wrong format detected: %q instead of %q`, format, FormatAtom)
}
}
func TestDetectAtomWithISOCharset(t *testing.T) {
data := `<?xml version="1.0" encoding="ISO-8859-15"?><feed xmlns="http://www.w3.org/2005/Atom"></feed>`
format := DetectFeedFormat(data)