Created
August 7, 2016 17:47
-
-
Save maksar/d9f8c6203baba64c02444e53858caf89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permissionProducer : Producer Permission | |
permissionProducer = | |
let permission i = case i of | |
1 -> VOTE | |
2 -> FORCE | |
_ -> NONE | |
in Check.Producer.map permission <| rangeInt 0 2 | |
userProducer : Producer User | |
userProducer = | |
Check.Producer.map (uncurry3 Actor.create) (Check.Producer.tuple3 ( string, bool, list permissionProducer )) | |
workflowProducer : Producer (Workflow String) | |
workflowProducer = | |
Check.Producer.map (\users -> List.foldl Workflow.approve (Workflow.init [1]) users) (list userProducer) | |
myClaims : Claim | |
myClaims = | |
Check.suite "Workflow" | |
[ | |
claim | |
"Workflow should remain in its bounds" | |
`true` (\w -> w.currentStep <= 1) | |
`for` workflowProducer | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment