module Main(main) where import Text.RSS import Test.HUnit import Data.Time.Calendar import Data.Time.LocalTime testChannel :: RSSChannel testChannel = RSSChannel { chTitle = "Example Channel" , chLink = "http://example.com/" , chDescription = "My example channel" , chDC = [], chImage = Nothing } testItems :: [RSSItem] testItems = [ RSSItem { title = "News for September the First" , link = "http://example.com/2002/09/01/" , description = Just "other things happend today" , content = Nothing , dc = [DCDate sep1] } , RSSItem { title = "News for September the Second" , link = "http://example.com/2002/09/02/" , description = Nothing , content = Nothing , dc = [DCDate sep2] } ] where sep1 = ZonedTime (LocalTime (fromGregorian 2002 9 1) (TimeOfDay 0 0 0)) (minutesToTimeZone 0) sep2 = ZonedTime (LocalTime (fromGregorian 2002 9 2) (TimeOfDay 0 0 0)) (minutesToTimeZone 0) testResult = "\n\ \\n\ \ \n\ \ Example Channelhttp://example.com/\n\ \ My example channel\n\ \ \n\ \ \n\ \ \n\ \ \n\ \ \n\ \ \n\ \ \n\ \ \n\ \ News for September the First\n\ \ http://example.com/2002/09/01/\n\ \ other things happend today\n\ \ 2002-09-01T00:00:00+00:00\n\ \ \n\ \ \n\ \ News for September the Second\n\ \ http://example.com/2002/09/02/\n\ \ 2002-09-02T00:00:00+00:00\n\ \ \n\ \" main = runTestTT $ test $ renderRSS testChannel testItems ~=? testResult