packages feed

sv 1.3 → 1.3.0.1

raw patch · 3 files changed

+15/−3 lines, 3 files

Files

changelog.md view
@@ -1,5 +1,9 @@ # Revision history for sv +## 1.3.0.1 -- 2019-02-26++* Fix an occasionally failing property-test+ ## 1.3 -- 2019-01-14  * Update to sv-core 0.4
sv.cabal view
@@ -1,5 +1,5 @@ name:                sv-version:             1.3+version:             1.3.0.1 license:             BSD3 license-file:        LICENCE author:              George Wilson
test/Data/Sv/CassavaTest.hs view
@@ -10,7 +10,7 @@ import qualified Data.Sv.Decode as Sv import Data.Sv.Encode (Encode) import qualified Data.Sv.Encode as E-import Data.Vector as V+import qualified Data.Vector as V import Data.Tuple.Only (Only (fromOnly)) import Hedgehog (Gen, TestLimit, (===), failure, forAll, property, withTests) import qualified Hedgehog.Gen as Gen@@ -25,7 +25,7 @@     , cassavaAgreement "char" Sv.char E.char (Gen.unicode)     , cassavaAgreement "integer" Sv.integer E.integer (Gen.integral (Range.linear (-10000000) 10000000))     , cassavaAgreement "string" Sv.string E.string (Gen.string (Range.linear 1 500) Gen.unicode)-    , cassavaAgreement' "bytestring" 5000 Sv.byteString E.byteString (Gen.utf8 (Range.linear 1 600) Gen.unicode)+    , cassavaAgreement' "bytestring" 5000 Sv.byteString E.byteString bsGen     , cassavaAgreement' "float" 5000 Sv.float E.float (Gen.float (Range.exponentialFloat (-1000000000) 1000000000))     , cassavaAgreement' "double" 5000 Sv.double E.double (Gen.double (Range.exponentialFloat (-1000000000) 1000000000))     ]@@ -51,3 +51,11 @@       Success sva -> do         csa === sva         sva === pure a++-- we filter out anything that is all spaces, since cassava and sv+-- behave differently in that case and I'll accept that.+bsGen :: Gen BS.ByteString+bsGen = Gen.filter p $ Gen.utf8 (Range.linear 1 600) Gen.unicode+  where+    p x = BS.null x || BS.any (not.isSpace) x+    isSpace = (<= 32)