pontarius-xmpp 0.4.4 → 0.4.5
raw patch · 2 files changed
+29/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- pontarius-xmpp.cabal +2/−1
- tests/Tests/Arbitrary/Common.hs +27/−0
pontarius-xmpp.cabal view
@@ -1,5 +1,5 @@ Name: pontarius-xmpp-Version: 0.4.4+Version: 0.4.5 Cabal-Version: >= 1.9.2 Build-Type: Custom License: BSD3@@ -152,6 +152,7 @@ , xml-types HS-Source-Dirs: tests Other-modules: Tests.Arbitrary+ , Tests.Arbitrary.Common , Tests.Arbitrary.Xml , Tests.Arbitrary.Xmpp , Tests.Parsers
+ tests/Tests/Arbitrary/Common.hs view
@@ -0,0 +1,27 @@+module Tests.Arbitrary.Common where++import Control.Applicative ((<$>))+import Data.Char+import qualified Data.Text as Text+import Test.QuickCheck+import Test.QuickCheck.Instances ()++shrinkText1 :: Text.Text -> [Text.Text]+shrinkText1 txt = filter (not . Text.null) $ shrink txt++shrinkTextMaybe :: Maybe Text.Text -> [Maybe Text.Text]+shrinkTextMaybe mbtxt = filter (\mb -> mb /= Just (Text.empty)) $ shrink mbtxt++genText1 :: Gen Text.Text+genText1 = Text.pack <$> string1+ where+ string1 = listOf1 arbitrary `suchThat` (not . all isSpace)++maybeGen :: Gen a -> Gen (Maybe a)+maybeGen g = oneof [ return Nothing+ , Just <$> g+ ]++shrinkMaybe :: (t -> [t]) -> Maybe t -> [Maybe t]+shrinkMaybe _s Nothing = []+shrinkMaybe s (Just x) = Nothing : map Just (s x)