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