First dumb unti test.

We're good to start
This commit is contained in:
Julien Lengrand-Lambert
2013-06-28 17:44:38 +02:00
parent 53cb6af0d2
commit 02a0fe1273
2 changed files with 10 additions and 4 deletions

View File

@@ -17,5 +17,8 @@ def bin_search(arr, t):
"""
Performs binary search on the input array.
Searches for t in arr, using a binary search.
Returns t index in arr if it is found, null otherwise
"""
Returns t index in arr if it is found, None otherwise
"""
return None

View File

@@ -11,10 +11,13 @@ import unittest
class test_bin_search(unittest.TestCase):
def setUp(self):
arr1 = [1, 2, 3, 4, 5]
self.arr1 = [1, 2, 3, 4, 5]
self.s1 = 3
self.res1 = None
def test_shuffle(self):
self.assertTrue(1, 1)
res = bin_search(self.arr1, self.s1)
self.assertEqual(res, self.res1)
if __name__ == '__main__':
unittest.main()