]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/syndication/syndication-tests.factor
io.streams.tee: more tests
[factor.git] / basis / syndication / syndication-tests.factor
old mode 100755 (executable)
new mode 100644 (file)
index 1ddcbf8..5e63aef
@@ -1,16 +1,13 @@
-USING: syndication io kernel io.files tools.test io.encodings.utf8
-calendar urls ;
+USING: syndication io kernel io.files tools.test io.encodings.binary
+calendar urls xml.writer ;
 IN: syndication.tests
 
-\ download-feed must-infer
-\ feed>xml must-infer
-
 : load-news-file ( filename -- feed )
-    #! Load an news syndication file and process it, returning
-    #! it as an feed tuple.
-    utf8 file-contents string>feed ;
+    ! Load an news syndication file and process it, returning
+    ! it as an feed tuple.
+    binary file-contents parse-feed ;
 
-[ T{
+{ T{
     feed
     f
     "Meerkat"
@@ -25,8 +22,8 @@ IN: syndication.tests
             f
         }
     }
-} ] [ "resource:basis/syndication/test/rss1.xml" load-news-file ] unit-test
-[ T{
+} } [ "vocab:syndication/test/rss1.xml" load-news-file ] unit-test
+{ T{
     feed
     f
     "dive into mark"
@@ -42,4 +39,5 @@ IN: syndication.tests
             T{ timestamp f 2003 12 13 8 29 29 T{ duration f 0 0 0 -4 0 0 } }
         }
     }
-} ] [ "resource:basis/syndication/test/atom.xml" load-news-file ] unit-test
+} } [ "vocab:syndication/test/atom.xml" load-news-file ] unit-test
+{ t } [ "vocab:syndication/test/atom.xml" load-news-file dup feed>xml xml>feed = ] unit-test