Skip to content

Commit

Permalink
Demo crash on false precondition
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesd committed Apr 29, 2016
1 parent be85edd commit d411fc1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ var DecCommand = &commands.ProtoCommand{
systemUnderTest.(*counter).Dec()
return nil
},
PreConditionFunc: func(state commands.State) bool {
return state.(int) > 0
},
NextStateFunc: func(state commands.State) commands.State {
return state.(int) - 1
},
Expand Down

0 comments on commit d411fc1

Please sign in to comment.