packages feed

gopro-plus 0.6.5.2 → 0.6.6.0

raw patch · 2 files changed

+35/−7 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ GoPro.Plus.Arbitrary: aString :: Gen String
+ GoPro.Plus.Arbitrary: aText :: Gen Text
+ GoPro.Plus.Arbitrary: gMaybe :: Gen a -> Gen (Maybe a)
+ GoPro.Plus.Arbitrary: instance Test.QuickCheck.Arbitrary.Arbitrary GoPro.Plus.Auth.AuthInfo

Files

gopro-plus.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.7.+-- This file has been generated from package.yaml by hpack version 0.35.0. -- -- see: https://github.com/sol/hpack  name:           gopro-plus-version:        0.6.5.2+version:        0.6.6.0 synopsis:       GoPro Plus Client API. description:    Please see the README on GitHub at <https://github.com/dustin/gopro-plus#readme> category:       Web
src/GoPro/Plus/Arbitrary.hs view
@@ -12,12 +12,15 @@ {-# OPTIONS_GHC -Wno-orphans #-} module GoPro.Plus.Arbitrary where +import           Data.Text                      (Text)+import qualified Data.Text                      as T import           Generic.Random                 (genericArbitrary, uniform)-import           Test.QuickCheck                (Arbitrary(..), vector, choose, arbitraryBoundedEnum)-import           Test.QuickCheck.Instances.Text ()+import           Test.QuickCheck                (Arbitrary (..), Gen, NonNegative (..), arbitraryBoundedEnum, choose,+                                                 elements, listOf, oneof, vector) import           Test.QuickCheck.Instances.Time () -import GoPro.Plus.Media+import           GoPro.Plus.Auth+import           GoPro.Plus.Media  instance Arbitrary FileInfo where arbitrary = genericArbitrary uniform @@ -39,9 +42,34 @@  instance Arbitrary File where arbitrary = genericArbitrary uniform -instance Arbitrary Medium where arbitrary = genericArbitrary uniform+instance Arbitrary AuthInfo where arbitrary = AuthInfo <$> aText <*> (getNonNegative <$> arbitrary) <*> aText <*> aText -instance Arbitrary Moment where arbitrary = genericArbitrary uniform+aString :: Gen String+aString = listOf (elements (['a'..'z'] <> ['A'..'Z'] <> ['0'..'9'] <> "?<>/.\\!@#$%^&*()_-'\";:{}[]"))++aText :: Gen Text+aText = T.pack <$> aString++gMaybe :: Gen a -> Gen (Maybe a)+gMaybe a = oneof [pure Nothing, Just <$> a]++instance Arbitrary Medium where+  arbitrary = Medium+    <$> aText+    <*> gMaybe aString+    <*> arbitrary+    <*> arbitrary+    <*> arbitrary+    <*> arbitrary+    <*> arbitrary+    <*> gMaybe aString+    <*> arbitrary+    <*> aString+    <*> arbitrary+    <*> arbitrary+    <*> gMaybe aString++instance Arbitrary Moment where arbitrary = Moment <$> aText <*> arbitrary  instance Arbitrary ReadyToViewType where arbitrary = arbitraryBoundedEnum