Created
October 11, 2011 21:02
-
-
Save ileacristian/1279427 to your computer and use it in GitHub Desktop.
python snippet
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
def test_gcd(): | |
assert gcd(0, 2) == 2 | |
assert gcd(2, 0) == 2 | |
assert gcd(2, 3) == 1 | |
assert gcd(2, 4) == 2 | |
assert gcd(6, 4) == 2 | |
assert gcd(24, 9) == 3 | |
try: | |
gcd(-2, 0) | |
gcd(0, -2) | |
gcd(0, 0) | |
assert False # linia A | |
except ValueError: | |
assert True # linia B |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment