packages feed

feed 0.3.11.0 → 0.3.11.1

raw patch · 3 files changed

+36/−1 lines, 3 filesdep ~HUnitdep ~basedep ~timePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: HUnit, base, time

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+#### 0.3.11.1++* Add missing file to dist of test-suite (thanks to Sergei Trofimovich)+ #### 0.3.11.0  * Add `toFeedDateStringUTC` which uses UTCTime rather than ClockTime (thanks to Emanuel Borsboom)
feed.cabal view
@@ -1,5 +1,5 @@ name:                feed-version:             0.3.11.0+version:             0.3.11.1 license:             BSD3 license-file:        LICENSE category:            Text@@ -74,6 +74,7 @@   type:              exitcode-stdio-1.0   other-modules:     Text.Atom.Tests+    Text.Feed.Util.Tests     Text.RSS.Equals     Text.RSS.Export.Tests     Text.RSS.Import.Tests
+ tests/Text/Feed/Util/Tests.hs view
@@ -0,0 +1,30 @@+module Text.Feed.Util.Tests where++import Data.Time+import Data.Time.Clock.POSIX+import Test.Framework (Test, testGroup)+import Test.HUnit (Assertion, assertEqual)+import Test.Framework.Providers.HUnit (testCase)+import Text.Feed.Types+import Text.Feed.Util+import System.Time++feedUtilTests :: Test+feedUtilTests = testGroup "Text.Feed.Util"+    [ testGroup "toFeedDateString[UTC]"+        [ testToFeedDateString AtomKind (read "2016-01-07 15:33:29 UTC") "2016-01-07T15:33:29Z"+        , testToFeedDateString (RSSKind Nothing) (read "2016-01-07 15:33:29 UTC") "Thu, 07 Jan 2016 15:33:29 GMT"+        , testToFeedDateString (RDFKind Nothing) (read "2016-01-07 15:33:29 UTC") "2016-01-07T15:33:29Z"+        ]+    ]++testToFeedDateString :: FeedKind -> UTCTime -> String -> Test+testToFeedDateString kind utct expectResult =+    testCase (show kind) testToDateString+  where+    testToDateString :: Assertion+    testToDateString = do+      assertEqual "toFeedDateStringUTC" expectResult (toFeedDateStringUTC kind utct)+      assertEqual "toFeedDateString" expectResult (toFeedDateString kind clockTime)+    clockTime =+      TOD (truncate $ utcTimeToPOSIXSeconds utct) 0