summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing_and_debugging/gcd.py10
-rw-r--r--testing_and_debugging/lcmtestcases.txt3
-rw-r--r--testing_and_debugging/testcases.txt3
3 files changed, 16 insertions, 0 deletions
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