packages feed

cursor-fuzzy-time-gen 0.1.0.0 → 0.2.0.0

raw patch · 5 files changed

+83/−32 lines, 5 filesdep −containersdep −deepseqdep −megaparsec

Dependencies removed: containers, deepseq, megaparsec, text

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Changelog +## [0.2.0.0] - 2024-01-18++### Changed++* Compatibility with `cursor-fuzzy-time >=0.1`+ ## [0.1.0.0] - 2021-11-21  ### Changed
cursor-fuzzy-time-gen.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.4.+-- This file has been generated from package.yaml by hpack version 0.35.2. -- -- see: https://github.com/sol/hpack ----- hash: 4119139874dfcc7fc0f43f35f396d037c86bc8ab18ce92bcbd26b601b5356a82+-- hash: a33aca5e06eb45598887c18496506f65c10de4782b991badebeeafe6d9ae068f  name:           cursor-fuzzy-time-gen-version:        0.1.0.0+version:        0.2.0.0 description:    Generators for the fuzzy time cursors category:       Time homepage:       https://github.com/NorfairKing/fuzzy-time@@ -32,16 +32,11 @@   ghc-options: -Wall   build-depends:       base >=4.9 && <=5-    , containers     , cursor-fuzzy-time     , cursor-gen-    , deepseq-    , fuzzy-time     , fuzzy-time-gen     , genvalidity     , genvalidity-time-    , megaparsec-    , time   default-language: Haskell2010  test-suite cursor-fuzzy-time-test@@ -61,13 +56,9 @@     , cursor-fuzzy-time     , cursor-fuzzy-time-gen     , fuzzy-time-    , genvalidity     , genvalidity-hspec     , genvalidity-hspec-optics-    , genvalidity-time     , hspec-    , megaparsec-    , text     , time   default-language: Haskell2010 @@ -80,8 +71,7 @@       bench/   ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall   build-depends:-      QuickCheck-    , base >=4.9 && <=5+      base >=4.9 && <=5     , criterion     , cursor-fuzzy-time     , cursor-fuzzy-time-gen
test/Cursor/FuzzyDaySpec.hs view
@@ -19,15 +19,31 @@     it "produces valid cursors" $ producesValid emptyFuzzyDayCursor     it "makes cursors that makes the guessing produce nothing" $       forAllValid $ \today ->-        fuzzyDayCursorGuess (emptyFuzzyDayCursor today) `shouldBe` Nothing+        fuzzyDayCursorGuessForwards (emptyFuzzyDayCursor today) `shouldBe` Nothing+    it "makes cursors that makes the guessing produce nothing" $+      forAllValid $ \today ->+        fuzzyDayCursorGuessBackwards (emptyFuzzyDayCursor today) `shouldBe` Nothing+   describe "makeFuzzyDayCursor" $ do     it "produces valid cursors" $ producesValid makeFuzzyDayCursor     it "makes cursors that makes the guessing produce the given time for recent days" $       forAll (ModifiedJulianDay . fromIntegral <$> (genValid :: Gen Int16)) $ \d ->-        fuzzyDayCursorGuess (makeFuzzyDayCursor d) `shouldBe` Just d-  describe "rebuildFuzzyDayCursor" $ do-    it "produces valid days" $ producesValid rebuildFuzzyDayCursor+        fuzzyDayCursorGuessForwards (makeFuzzyDayCursor d) `shouldBe` Just d+    it "makes cursors that makes the guessing produce the given time for recent days" $+      forAll (ModifiedJulianDay . fromIntegral <$> (genValid :: Gen Int16)) $ \d ->+        fuzzyDayCursorGuessBackwards (makeFuzzyDayCursor d) `shouldBe` Just d++  describe "rebuildFuzzyDayCursorForwards" $ do+    it "produces valid days" $ producesValid rebuildFuzzyDayCursorForwards+  describe "rebuildFuzzyDayCursorBackwards" $ do+    it "produces valid days" $ producesValid rebuildFuzzyDayCursorBackwards+   describe "fuzzyDayCursorTextCursorL" $     lensSpec fuzzyDayCursorTextCursorL-  describe "fuzzyDayCursorGuess" $-    it "guesses a valid day" $ producesValid fuzzyDayCursorGuess++  describe "fuzzyDayCursorGuessForwards" $+    it "guesses a valid day" $+      producesValid fuzzyDayCursorGuessForwards+  describe "fuzzyDayCursorGuessBackwards" $+    it "guesses a valid day" $+      producesValid fuzzyDayCursorGuessBackwards
test/Cursor/FuzzyLocalTimeSpec.hs view
@@ -16,26 +16,46 @@ spec = do   eqSpec @FuzzyLocalTimeCursor   genValidSpec @FuzzyLocalTimeCursor+   describe "emptyFuzzyLocalTimeCursor" $ do     it "produces valid cursors" $       producesValid emptyFuzzyLocalTimeCursor     it "makes cursors that makes the guessing produce nothing" $       forAllValid $ \today ->-        fuzzyLocalTimeCursorGuess (emptyFuzzyLocalTimeCursor today)+        fuzzyLocalTimeCursorGuessForwards (emptyFuzzyLocalTimeCursor today)           `shouldBe` Nothing+    it "makes cursors that makes the guessing produce nothing" $+      forAllValid $ \today ->+        fuzzyLocalTimeCursorGuessBackwards (emptyFuzzyLocalTimeCursor today)+          `shouldBe` Nothing+   describe "makeFuzzyLocalTimeCursor" $ do     it "produces valid cursors" $       producesValid makeFuzzyLocalTimeCursor     it "makes cursors that makes the guessing produce the given time for recent days" $       forAll (ModifiedJulianDay . fromIntegral <$> (genValid :: Gen Int16)) $ \d ->-        fuzzyLocalTimeCursorGuess+        fuzzyLocalTimeCursorGuessForwards           (makeFuzzyLocalTimeCursor (OnlyDaySpecified d))           `shouldBe` Just (OnlyDaySpecified d)-  describe "rebuildFuzzyLocalTimeCursor" $ do+    it "makes cursors that makes the guessing produce the given time for recent days" $+      forAll (ModifiedJulianDay . fromIntegral <$> (genValid :: Gen Int16)) $ \d ->+        fuzzyLocalTimeCursorGuessBackwards+          (makeFuzzyLocalTimeCursor (OnlyDaySpecified d))+          `shouldBe` Just (OnlyDaySpecified d)++  describe "rebuildFuzzyLocalTimeCursorForwards" $ do     it "produces valid time of day" $-      producesValid rebuildFuzzyLocalTimeCursor+      producesValid rebuildFuzzyLocalTimeCursorForwards+  describe "rebuildFuzzyLocalTimeCursorBackwards" $ do+    it "produces valid time of day" $+      producesValid rebuildFuzzyLocalTimeCursorBackwards+   describe "fuzzyLocalTimeCursorTextCursorL" $     lensSpec fuzzyLocalTimeCursorTextCursorL-  describe "fuzzyLocalTimeCursorGuess" $++  describe "fuzzyLocalTimeCursorGuessForwards" $     it "guesses a valid time of day" $-      producesValid fuzzyLocalTimeCursorGuess+      producesValid fuzzyLocalTimeCursorGuessForwards+  describe "fuzzyLocalTimeCursorGuessBackwards" $+    it "guesses a valid time of day" $+      producesValid fuzzyLocalTimeCursorGuessBackwards
test/Cursor/FuzzyTimeOfDaySpec.hs view
@@ -12,24 +12,43 @@ spec = do   eqSpec @FuzzyTimeOfDayCursor   genValidSpec @FuzzyTimeOfDayCursor+   describe "emptyFuzzyTimeOfDayCursor" $ do     it "produces valid cursors" $       producesValid emptyFuzzyTimeOfDayCursor     it "makes cursors that makes the guessing produce nothing" $       forAllValid $ \today ->-        fuzzyTimeOfDayCursorGuess (emptyFuzzyTimeOfDayCursor today)+        fuzzyTimeOfDayCursorGuessForwards (emptyFuzzyTimeOfDayCursor today)           `shouldBe` Nothing+    it "makes cursors that makes the guessing produce nothing" $+      forAllValid $ \today ->+        fuzzyTimeOfDayCursorGuessBackwards (emptyFuzzyTimeOfDayCursor today)+          `shouldBe` Nothing+   describe "makeFuzzyTimeOfDayCursor" $ do     it "produces valid cursors" $       producesValid makeFuzzyTimeOfDayCursor     it "makes cursors that makes the guessing produce the given time" $       forAllValid $ \d ->-        fuzzyTimeOfDayCursorGuess (makeFuzzyTimeOfDayCursor d) `shouldBe` Just d-  describe "rebuildFuzzyTimeOfDayCursor" $ do+        fuzzyTimeOfDayCursorGuessForwards (makeFuzzyTimeOfDayCursor d) `shouldBe` Just d+    it "makes cursors that makes the guessing produce the given time" $+      forAllValid $ \d ->+        fuzzyTimeOfDayCursorGuessBackwards (makeFuzzyTimeOfDayCursor d) `shouldBe` Just d++  describe "rebuildFuzzyTimeOfDayCursorForwards" $ do     it "produces valid time of day" $-      producesValid rebuildFuzzyTimeOfDayCursor+      producesValid rebuildFuzzyTimeOfDayCursorForwards++  describe "rebuildFuzzyTimeOfDayCursorBackwards" $ do+    it "produces valid time of day" $+      producesValid rebuildFuzzyTimeOfDayCursorBackwards+   describe "fuzzyTimeOfDayCursorTextCursorL" $     lensSpec fuzzyTimeOfDayCursorTextCursorL-  describe "fuzzyTimeOfDayCursorGuess" $++  describe "fuzzyTimeOfDayCursorGuessForwards" $     it "guesses a valid time of day" $-      producesValid fuzzyTimeOfDayCursorGuess+      producesValid fuzzyTimeOfDayCursorGuessForwards+  describe "fuzzyTimeOfDayCursorGuessBackwards" $+    it "guesses a valid time of day" $+      producesValid fuzzyTimeOfDayCursorGuessBackwards