mirror of
https://github.com/jlengrand/Coding4Interviews.git
synced 2026-03-10 08:11:24 +00:00
First dumb unti test.
We're good to start
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user