Last active
December 19, 2020 20:16
-
-
Save benjjo/5b18537321d54391c59859b3be3ffa57 to your computer and use it in GitHub Desktop.
Simple test fnction
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
failed = 0 | |
ran = 0 | |
def test(name, actual, expected): | |
"""Report if test passed or failed.""" | |
global ran, failed | |
if actual == expected: | |
print(name, 'OK') | |
else: | |
print(name, 'FAILED: got', actual, 'instead of', expected) | |
failed += 1 | |
ran += 1 | |
test('Running a simple test; expect 0.', functionToTest(args), 0) | |
print('================================================') | |
print('All tests run:', ran - failed, 'OK,', failed, 'FAILED') | |
print('================================================') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment