aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader/parser/format_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'reader/parser/format_test.go')
-rw-r--r--reader/parser/format_test.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/reader/parser/format_test.go b/reader/parser/format_test.go
index 3795541..b2836b6 100644
--- a/reader/parser/format_test.go
+++ b/reader/parser/format_test.go
@@ -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)