Skip to content

Commit

Permalink
Support zero or 1 arg to randomInt
Browse files Browse the repository at this point in the history
Making lower and upper or lower bound optional
  • Loading branch information
mfussenegger committed Jul 28, 2019
1 parent b1308b3 commit 54b85b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Fake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ eval (FunctionCall (Function "ulid" [])) = getUlid
eval (FunctionCall (Function "null" [])) = pure Null
eval (FunctionCall (Function "randomBool" [])) = randomBool
eval (FunctionCall (Function "randomChar" [])) = randomChar
eval (FunctionCall (Function "randomInt" [])) = randomInt (IntLiteral 0) (IntLiteral 2147483647)
eval (FunctionCall (Function "randomInt" [upper])) = randomInt (IntLiteral 0) upper
eval (FunctionCall (Function "randomInt" [lower, upper])) = randomInt lower upper
eval (FunctionCall (Function "randomDouble" [lower, upper])) = randomDouble lower upper
eval (FunctionCall (Function "randomDate" [])) = dayAsValue <$> randomDate Nothing Nothing
Expand Down

0 comments on commit 54b85b9

Please sign in to comment.