]> gitweb.factorcode.org Git - factor.git/blob - extra/rss/rss-tests.factor
More unit test fixes
[factor.git] / extra / rss / rss-tests.factor
1 USING: rss io kernel io.files tools.test io.encodings.utf8 ;
2 IN: rss.tests
3
4 : load-news-file ( filename -- feed )
5     #! Load an news syndication file and process it, returning
6     #! it as an feed tuple.
7     utf8 <file-reader> read-feed ;
8
9 [ T{
10     feed
11     f
12     "Meerkat"
13     "http://meerkat.oreillynet.com"
14     {
15         T{
16             entry
17             f
18             "XML: A Disruptive Technology"
19             "http://c.moreover.com/click/here.pl?r123"
20             "\n      XML is placing increasingly heavy loads on the existing technical\n      infrastructure of the Internet.\n    "
21             f
22         }
23     }
24 } ] [ "extra/rss/rss1.xml" resource-path load-news-file ] unit-test
25 [ T{
26     feed
27     f
28     "dive into mark"
29     "http://example.org/"
30     {
31         T{
32             entry
33             f
34             "Atom draft-07 snapshot"
35             "http://example.org/2005/04/02/atom"
36             "\n         <div xmlns=\"http://www.w3.org/1999/xhtml\">\n           <p><i>[Update: The Atom draft is finished.]</i></p>\n         </div>\n       "
37
38             "2003-12-13T08:29:29-04:00"
39         }
40     }
41 } ] [ "extra/rss/atom.xml" resource-path load-news-file ] unit-test