Skip to content

Commit

Permalink
Use correct combinator in generators for optional values
Browse files Browse the repository at this point in the history
  • Loading branch information
HuwCampbell committed Sep 27, 2024
1 parent 41d4902 commit a8d1588
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions test/Test/Avro/Schema/Roundtrip.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import qualified Avro.Schema as Schema
import qualified Avro.Value as Avro
import Avro.Name (TypeName(..))

import Control.Applicative
import qualified Data.Aeson as Aeson
import Data.Function (on)
import qualified Data.List as List
Expand Down Expand Up @@ -200,26 +199,26 @@ fuzzSchema =
[ pure Schema.Null
, pure Schema.Boolean
, Schema.Int
<$> optional (pure <$> Gen.ascii)
<$> Gen.maybe (pure <$> Gen.ascii)
, Schema.Long
<$> optional (pure <$> Gen.ascii)
<$> Gen.maybe (pure <$> Gen.ascii)
, pure Schema.Float
, pure Schema.Double
, Schema.Bytes
<$> optional (pure <$> Gen.ascii)
<$> Gen.maybe (pure <$> Gen.ascii)
, Schema.Enum
<$> fuzzName
<*> Gen.list (Range.linear 0 5) fuzzName
<*> optional (pure <$> Gen.ascii)
<*> Gen.maybe (pure <$> Gen.ascii)
<*> fuzzSuits
<*> pure Nothing
, Schema.Fixed
<$> fuzzName
<*> Gen.list (Range.linear 0 5) fuzzName
<*> Gen.int (Range.linear 0 20)
<*> optional (pure <$> Gen.ascii)
<*> Gen.maybe (pure <$> Gen.ascii)
, Schema.String
<$> optional (pure <$> Gen.ascii)
<$> Gen.maybe (pure <$> Gen.ascii)
]

[ Schema.Array
Expand All @@ -229,7 +228,7 @@ fuzzSchema =
, Schema.Record
<$> fuzzName
<*> Gen.list (Range.linear 0 5) fuzzName
<*> optional (pure <$> Gen.ascii)
<*> Gen.maybe (pure <$> Gen.ascii)
<*> (nubFields <$> Gen.list (Range.linear 1 5) fuzzField)
, Schema.Union . nubSchemas . flattenUnions
<$> Gen.list (Range.linear 1 5) fuzzSchema
Expand Down

0 comments on commit a8d1588

Please sign in to comment.