aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès2009-01-05 16:15:50 +0100
committerLudovic Courtès2009-01-05 16:15:50 +0100
commitfd9a9dc8ff1c4b7e77a28b4556e62620d15b1293 (patch)
treec1fc6cdc2dfcf4f24743af65c27e0f84151f91a9 /tests
parent5b8d38f3c22a0e241568d70fdb6d372561683389 (diff)
downloadskribilo-fd9a9dc8ff1c4b7e77a28b4556e62620d15b1293.tar.gz
skribilo-fd9a9dc8ff1c4b7e77a28b4556e62620d15b1293.tar.lz
skribilo-fd9a9dc8ff1c4b7e77a28b4556e62620d15b1293.zip
rss-2: Improve tests.
* tests/readers/rss-2.test ("broken date format", "table"): New tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/readers/rss-2.test62
1 files changed, 59 insertions, 3 deletions
diff --git a/tests/readers/rss-2.test b/tests/readers/rss-2.test
index 99ddf58..53e2b8c 100644
--- a/tests/readers/rss-2.test
+++ b/tests/readers/rss-2.test
@@ -1,6 +1,6 @@
;;; Excercise RSS 2.0 reader. -*- Scheme -*-
;;;
-;;; Copyright (C) 2008 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright (C) 2008, 2009 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Skribilo.
;;;
@@ -48,7 +48,7 @@
(test-match "basic"
`(document ,'#:title (list "The Channel")
(chapter ,'#:title (list "Foo Bar")
- ,_
+ ,_ ;; the date
(list "Hello world.")))
"<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
@@ -69,7 +69,7 @@
(test-match "with HTML markup"
`(document ,'#:title (list (emph "The") " Channel")
(chapter ,'#:title (list "Foo " (bold "&") " Bar")
- ,_
+ ,_ ;; the date
(list (p "Hello world."))))
"<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
@@ -87,6 +87,62 @@
</channel>
</rss>")
+(test-match "broken date format"
+ `(document ,'#:title (list "The Channel")
+ (chapter ,'#:title (list "Foo Bar")
+ ,_ ;; the date
+ (list "Hello world.")))
+
+"<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
+ <rss version=\"2.0\">
+ <channel>
+ <title>The Channel</title>
+ <link>http://example.net/</link>
+ <description>Some channel description...</description>
+
+ <item>
+ <title>Foo Bar</title>
+ <!-- Feeds at livejournal.com, e.g.,
+ http://udrepper.livejournal.com/rss.xml contain a broken date with,
+ e.g., \"GMT\" instead of \"+0000\". -->
+ <pubDate>Mon, 06 Jun 2005 23:05:00 GMT</pubDate>
+ <description>Hello world.</description>
+ </item>
+ </channel>
+ </rss>")
+
+(test-match "table"
+ `(document ,'#:title (list "The Channel")
+ (chapter ,'#:title (list "Foo Bar")
+ ,_ ;; the date
+ (list
+ ,_ ,_ ;; whitespace
+ (table
+ (th (td "Foo") (td "Bar"))
+ (tr (td "001") (td "002")))
+ ,_ ,_ ;; whitespace
+ )))
+
+"<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>
+ <rss version=\"2.0\">
+ <channel>
+ <title>The Channel</title>
+ <link>http://example.net/</link>
+ <description>Some channel description...</description>
+
+ <item>
+ <title>Foo Bar</title>
+ <pubDate>Mon, 06 Jun 2005 23:05:00 +0200</pubDate>
+ <description>
+ &lt;table&gt;
+ &lt;th&gt;&lt;td&gt;Foo&lt;/td&gt;&lt;td&gt;Bar&lt;/td&gt;&lt;/th&gt;
+ &lt;tr&gt;&lt;td&gt;001&lt;/td&gt;&lt;td&gt;002&lt;/td&gt;&lt;/tr&gt;
+ &lt;/table&gt;
+ </description>
+ </item>
+ </channel>
+ </rss>")
+
(test-end "rss-2")