packages feed

cursor-fuzzy-time-gen 0.0.0.0 → 0.1.0.0

raw patch · 11 files changed

+57/−72 lines, 11 filessetup-changed

Files

+ CHANGELOG.md view
@@ -0,0 +1,7 @@+# Changelog++## [0.1.0.0] - 2021-11-21++### Changed++* Compatibility with `genvalidity >=1.0.0.0`
LICENSE view
@@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017-2020 Tom Sydney Kerckhove+Copyright (c) 2017-2021 Tom Sydney Kerckhove  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
− Setup.hs
@@ -1,3 +0,0 @@-import Distribution.Simple--main = defaultMain
bench/Bench.hs view
@@ -3,20 +3,18 @@ module Main where  import Criterion.Main as Criterion--import Data.GenValidity.Criterion- import Cursor.FuzzyDay import Cursor.FuzzyDay.Gen () import Cursor.FuzzyLocalTime import Cursor.FuzzyLocalTime.Gen () import Cursor.FuzzyTimeOfDay import Cursor.FuzzyTimeOfDay.Gen ()+import Data.GenValidity.Criterion  main :: IO () main =   Criterion.defaultMain-    [ genValidBench @FuzzyDayCursor-    , genValidBench @FuzzyLocalTimeCursor-    , genValidBench @FuzzyTimeOfDayCursor+    [ genValidBench @FuzzyDayCursor,+      genValidBench @FuzzyLocalTimeCursor,+      genValidBench @FuzzyTimeOfDayCursor     ]
cursor-fuzzy-time-gen.cabal view
@@ -1,22 +1,24 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.33.0.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack ----- hash: 6e24e29e40687b3222d1ff320499f360a01a7a4956719fe9097bf01a83cb1b08+-- hash: 4119139874dfcc7fc0f43f35f396d037c86bc8ab18ce92bcbd26b601b5356a82  name:           cursor-fuzzy-time-gen-version:        0.0.0.0+version:        0.1.0.0 description:    Generators for the fuzzy time cursors category:       Time homepage:       https://github.com/NorfairKing/fuzzy-time author:         Tom Sydney Kerckhove maintainer:     syd@cs-syd.eu-copyright:      Copyright: (c) 2017-2020 Tom Sydney Kerckhove+copyright:      Copyright: (c) 2017-2021 Tom Sydney Kerckhove license:        MIT license-file:   LICENSE build-type:     Simple+extra-source-files:+    CHANGELOG.md  library   exposed-modules:
src/Cursor/FuzzyDay/Gen.hs view
@@ -2,14 +2,10 @@  module Cursor.FuzzyDay.Gen where +import Cursor.FuzzyDay+import Cursor.Text.Gen () import Data.GenValidity import Data.GenValidity.Time ()--import Cursor.Text.Gen ()--import Cursor.FuzzyDay--instance GenUnchecked FuzzyDayCursor  instance GenValid FuzzyDayCursor where   genValid = genValidStructurallyWithoutExtraChecking
src/Cursor/FuzzyLocalTime/Gen.hs view
@@ -2,15 +2,11 @@  module Cursor.FuzzyLocalTime.Gen where +import Cursor.FuzzyLocalTime+import Cursor.Text.Gen () import Data.FuzzyTime.Types.Gen () import Data.GenValidity import Data.GenValidity.Time ()--import Cursor.Text.Gen ()--import Cursor.FuzzyLocalTime--instance GenUnchecked FuzzyLocalTimeCursor  instance GenValid FuzzyLocalTimeCursor where   genValid = genValidStructurallyWithoutExtraChecking
src/Cursor/FuzzyTimeOfDay/Gen.hs view
@@ -2,14 +2,10 @@  module Cursor.FuzzyTimeOfDay.Gen where +import Cursor.FuzzyTimeOfDay+import Cursor.Text.Gen () import Data.GenValidity import Data.GenValidity.Time ()--import Cursor.Text.Gen ()--import Cursor.FuzzyTimeOfDay--instance GenUnchecked FuzzyTimeOfDayCursor  instance GenValid FuzzyTimeOfDayCursor where   genValid = genValidStructurallyWithoutExtraChecking
test/Cursor/FuzzyDaySpec.hs view
@@ -2,35 +2,32 @@  module Cursor.FuzzyDaySpec where +import Cursor.FuzzyDay+import Cursor.FuzzyDay.Gen () import Data.Int import Data.Time- import Test.Hspec import Test.QuickCheck import Test.Validity import Test.Validity.Optics -import Cursor.FuzzyDay-import Cursor.FuzzyDay.Gen ()- spec :: Spec spec = do-  eqSpecOnValid @FuzzyDayCursor+  eqSpec @FuzzyDayCursor   genValidSpec @FuzzyDayCursor   describe "emptyFuzzyDayCursor" $ do-    it "produces valid cursors" $ producesValidsOnValids emptyFuzzyDayCursor+    it "produces valid cursors" $ producesValid emptyFuzzyDayCursor     it "makes cursors that makes the guessing produce nothing" $       forAllValid $ \today ->         fuzzyDayCursorGuess (emptyFuzzyDayCursor today) `shouldBe` Nothing   describe "makeFuzzyDayCursor" $ do-    it "produces valid cursors" $ producesValidsOnValids makeFuzzyDayCursor-    it-      "makes cursors that makes the guessing produce the given time for recent days" $+    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" $ producesValidsOnValids rebuildFuzzyDayCursor+    it "produces valid days" $ producesValid rebuildFuzzyDayCursor   describe "fuzzyDayCursorTextCursorL" $-    lensSpecOnValid fuzzyDayCursorTextCursorL+    lensSpec fuzzyDayCursorTextCursorL   describe "fuzzyDayCursorGuess" $-    it "guesses a valid day" $ producesValidsOnValids fuzzyDayCursorGuess+    it "guesses a valid day" $ producesValid fuzzyDayCursorGuess
test/Cursor/FuzzyLocalTimeSpec.hs view
@@ -2,43 +2,40 @@  module Cursor.FuzzyLocalTimeSpec where +import Cursor.FuzzyLocalTime+import Cursor.FuzzyLocalTime.Gen ()+import Data.FuzzyTime.Types import Data.Int import Data.Time- import Test.Hspec import Test.QuickCheck import Test.Validity import Test.Validity.Optics -import Cursor.FuzzyLocalTime-import Cursor.FuzzyLocalTime.Gen ()-import Data.FuzzyTime.Types- spec :: Spec spec = do-  eqSpecOnValid @FuzzyLocalTimeCursor+  eqSpec @FuzzyLocalTimeCursor   genValidSpec @FuzzyLocalTimeCursor   describe "emptyFuzzyLocalTimeCursor" $ do     it "produces valid cursors" $-      producesValidsOnValids emptyFuzzyLocalTimeCursor+      producesValid emptyFuzzyLocalTimeCursor     it "makes cursors that makes the guessing produce nothing" $       forAllValid $ \today ->-        fuzzyLocalTimeCursorGuess (emptyFuzzyLocalTimeCursor today) `shouldBe`-        Nothing+        fuzzyLocalTimeCursorGuess (emptyFuzzyLocalTimeCursor today)+          `shouldBe` Nothing   describe "makeFuzzyLocalTimeCursor" $ do     it "produces valid cursors" $-      producesValidsOnValids makeFuzzyLocalTimeCursor-    it-      "makes cursors that makes the guessing produce the given time for recent days" $+      producesValid makeFuzzyLocalTimeCursor+    it "makes cursors that makes the guessing produce the given time for recent days" $       forAll (ModifiedJulianDay . fromIntegral <$> (genValid :: Gen Int16)) $ \d ->         fuzzyLocalTimeCursorGuess-          (makeFuzzyLocalTimeCursor (OnlyDaySpecified d)) `shouldBe`-        Just (OnlyDaySpecified d)+          (makeFuzzyLocalTimeCursor (OnlyDaySpecified d))+          `shouldBe` Just (OnlyDaySpecified d)   describe "rebuildFuzzyLocalTimeCursor" $ do     it "produces valid time of day" $-      producesValidsOnValids rebuildFuzzyLocalTimeCursor+      producesValid rebuildFuzzyLocalTimeCursor   describe "fuzzyLocalTimeCursorTextCursorL" $-    lensSpecOnValid fuzzyLocalTimeCursorTextCursorL+    lensSpec fuzzyLocalTimeCursorTextCursorL   describe "fuzzyLocalTimeCursorGuess" $     it "guesses a valid time of day" $-    producesValidsOnValids fuzzyLocalTimeCursorGuess+      producesValid fuzzyLocalTimeCursorGuess
test/Cursor/FuzzyTimeOfDaySpec.hs view
@@ -2,35 +2,34 @@  module Cursor.FuzzyTimeOfDaySpec where +import Cursor.FuzzyTimeOfDay+import Cursor.FuzzyTimeOfDay.Gen () import Test.Hspec import Test.Validity import Test.Validity.Optics -import Cursor.FuzzyTimeOfDay-import Cursor.FuzzyTimeOfDay.Gen ()- spec :: Spec spec = do-  eqSpecOnValid @FuzzyTimeOfDayCursor+  eqSpec @FuzzyTimeOfDayCursor   genValidSpec @FuzzyTimeOfDayCursor   describe "emptyFuzzyTimeOfDayCursor" $ do     it "produces valid cursors" $-      producesValidsOnValids emptyFuzzyTimeOfDayCursor+      producesValid emptyFuzzyTimeOfDayCursor     it "makes cursors that makes the guessing produce nothing" $       forAllValid $ \today ->-        fuzzyTimeOfDayCursorGuess (emptyFuzzyTimeOfDayCursor today) `shouldBe`-        Nothing+        fuzzyTimeOfDayCursorGuess (emptyFuzzyTimeOfDayCursor today)+          `shouldBe` Nothing   describe "makeFuzzyTimeOfDayCursor" $ do     it "produces valid cursors" $-      producesValidsOnValids makeFuzzyTimeOfDayCursor+      producesValid makeFuzzyTimeOfDayCursor     it "makes cursors that makes the guessing produce the given time" $       forAllValid $ \d ->         fuzzyTimeOfDayCursorGuess (makeFuzzyTimeOfDayCursor d) `shouldBe` Just d   describe "rebuildFuzzyTimeOfDayCursor" $ do     it "produces valid time of day" $-      producesValidsOnValids rebuildFuzzyTimeOfDayCursor+      producesValid rebuildFuzzyTimeOfDayCursor   describe "fuzzyTimeOfDayCursorTextCursorL" $-    lensSpecOnValid fuzzyTimeOfDayCursorTextCursorL+    lensSpec fuzzyTimeOfDayCursorTextCursorL   describe "fuzzyTimeOfDayCursorGuess" $     it "guesses a valid time of day" $-    producesValidsOnValids fuzzyTimeOfDayCursorGuess+      producesValid fuzzyTimeOfDayCursorGuess