-
-
Save jasongorman/f22ebea05994d6087d42a0f958097ee0 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
from assertion import assert_equals | |
from assertion import assert_raises | |
from maths import sqrt | |
def run(): | |
print('Running sqrt tests...') | |
assert_equals('sqrt of 0.0', 0.0, sqrt(0.0)) | |
assert_equals('sqrt of 1.0', 1.0, sqrt(1.0)) | |
assert_equals('sqrt of 4.0', 2.0, sqrt(4.0)) | |
assert_equals('sqrt of 6.25', 2.5, sqrt(6.25)) | |
assert_raises("sqrt of -1.0", Exception, lambda: sqrt(-1.0)) | |
if __name__ == '__main__': | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment