From 7115a52508ea7aa4373b6ddeadc7ea355b63c7ab Mon Sep 17 00:00:00 2001 From: Jovina Date: Tue, 19 Jul 2011 16:25:20 +0530 Subject: 3 files added to 'testing and debugging'. --- testing_and_debugging/gcd.py | 10 ++++++++++ testing_and_debugging/lcmtestcases.txt | 3 +++ testing_and_debugging/testcases.txt | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 testing_and_debugging/gcd.py create mode 100644 testing_and_debugging/lcmtestcases.txt create mode 100644 testing_and_debugging/testcases.txt (limited to 'testing_and_debugging') diff --git a/testing_and_debugging/gcd.py b/testing_and_debugging/gcd.py new file mode 100644 index 0000000..b8d1296 --- /dev/null +++ b/testing_and_debugging/gcd.py @@ -0,0 +1,10 @@ +def gcd(a, b): + if b == 0: + return a + return gcd(b, a%b) + +if __name__ == '__main__': + result = gcd(48, 64) + if result != 16: + print "Test failed" + print "Test Passed" diff --git a/testing_and_debugging/lcmtestcases.txt b/testing_and_debugging/lcmtestcases.txt new file mode 100644 index 0000000..9097077 --- /dev/null +++ b/testing_and_debugging/lcmtestcases.txt @@ -0,0 +1,3 @@ +12 28 84 +18 36 36 +4678 39763 79562 diff --git a/testing_and_debugging/testcases.txt b/testing_and_debugging/testcases.txt new file mode 100644 index 0000000..9144f6c --- /dev/null +++ b/testing_and_debugging/testcases.txt @@ -0,0 +1,3 @@ +12 28 4 +18 36 18 +4678 39763 2339 -- cgit