packages feed

cron 0.4.1.1 → 0.4.1.2

raw patch · 4 files changed

+15/−4 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

changelog view
@@ -1,4 +1,6 @@ # 0.4.1.1+* Bug fix for checking nextMatch where either the day of month or day of week fields were a singleton list of star.+# 0.4.1.1 * Fix test suite for Stackage. # 0.4.1 * Compatibility release to get cron building with GHC < 7.10 again.
cron.cabal view
@@ -1,5 +1,5 @@ Name:                cron-Version:             0.4.1.1+Version:             0.4.1.2 Description:   Cron data structure and Attoparsec parser. The idea is to embed it in larger   systems which want to roll their own scheduled tasks in a format that people
src/System/Cron/Internal/Check.hs view
@@ -271,5 +271,7 @@ restricted = not . isStar  isStar :: CronField -> Bool-isStar (Field Star) = True-isStar _            = False+isStar (Field Star)    = True+isStar (ListField bfs) = FT.any (== Star) bfs+isStar (StepField' sf) = sfField sf == Star && sfStepping sf == 1+isStar _               = False
test/System/Test/Cron.hs view
@@ -279,8 +279,15 @@              Nothing -> counterexample ("Could not find a next minute match for " <> show t <> ", expected " <> show res) False         Nothing -> property True   , testProperty "a schedule that produces Just for one t will produce it for any t" $ \cs t1 t2 -> isJust (nextMatch cs t1) ==>-      counterexample ("nextMatch produced Just for " <> show t1 <> " but not " <> show t2) +      counterexample ("nextMatch produced Just for " <> show t1 <> " but not " <> show t2)                      (isJust (nextMatch cs t2) == True)+  , testCase "does not match impossible dates (restricted dow/dom bug)" $ do+      let t = posixSecondsToUTCTime 0+      let cs = stars { month = mkMonthSpec' (Field (SpecificField' (mkSpecificField' 9)))+                     , dayOfMonth = mkDayOfMonthSpec' (ListField (SpecificField' (mkSpecificField' 31) :| []))+                     , dayOfWeek = mkDayOfWeekSpec' (ListField (Star :| []))+                     }+      nextMatch cs t @?= Nothing   ]