summaryrefslogtreecommitdiff
path: root/testing_and_debugging
diff options
context:
space:
mode:
authorJovina2011-07-19 16:25:20 +0530
committerJovina2011-07-19 16:25:20 +0530
commit7115a52508ea7aa4373b6ddeadc7ea355b63c7ab (patch)
tree03fc472992681dc68d106c3bd42b22a0efa727d6 /testing_and_debugging
parentc6205e5253a8baad6f54ad8b89acdbdd8f7d08b4 (diff)
downloadst-scripts-7115a52508ea7aa4373b6ddeadc7ea355b63c7ab.tar.gz
st-scripts-7115a52508ea7aa4373b6ddeadc7ea355b63c7ab.tar.bz2
st-scripts-7115a52508ea7aa4373b6ddeadc7ea355b63c7ab.zip
3 files added to 'testing and debugging'.
Diffstat (limited to 'testing_and_debugging')
-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