Created
February 27, 2014 19:50
-
-
Save Skrylar/9258024 to your computer and use it in GitHub Desktop.
Using 'check' prevents propagation of changes to variable parameters.
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
import unittest | |
proc doThings(spuds: var int): int = | |
spuds = 24 | |
return 99 | |
suite "broken": | |
test "count the spuds": | |
var spuds = 0 | |
check doThings(spuds) == 99 | |
check spuds == 24 # fails, spuds is still 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment