Skip to content

Commit

Permalink
Merge pull request #83 from purescript/string-gen-size
Browse files Browse the repository at this point in the history
Ensure `genString` always generates at least one character
  • Loading branch information
garyb authored Jun 6, 2017
2 parents c4158c1 + 3c84498 commit dc78175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/String/Gen.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Data.String as S
-- | Generates a string using the specified character generator.
genString :: forall m. MonadRec m => MonadGen m => m Char -> m String
genString genChar = sized \size -> do
newSize <- chooseInt 1 size
newSize <- chooseInt 1 (max 1 size)
resize (const newSize) $ S.fromCharArray <$> unfoldable genChar

-- | Generates a string using characters from the Unicode basic multilingual
Expand Down

0 comments on commit dc78175

Please sign in to comment.