def test_search(self): arr = [1, 2, 3, 4, 5] self.assertEqual(search(arr, 5), 4) arr = [] self.assertEqual(search(arr, 5), None) arr = [1, 2, 3, 4, 5] self.assertEqual(search(arr, 11), None)
def test_search(self): arr = [1, 2, 3, 4, 5] self.assertEqual(search(arr, 5), 4) arr2 = [] self.assertEqual(search(arr2, 5), None) arr3 = [1, 2, 3] self.assertEqual(search(arr3, 4), None) arr4 = [1, 2, 3, 4, 5] self.assertEqual(search(arr4, 2), 1)
def test_search(self): arr = [1, 2, 3, 4, 5] self.assertEqual(search(arr, 5), 4) arr = [] self.assertEqual(search(arr, 5), None) arr = [2, 4, 6, 8, 10, 12, 14, 16] self.assertEqual(search(arr, 10), 4) arr = [1, 2, 3, 4, 5, 6, 7] self.assertEqual(search(arr, 2), 1) self.assertEqual(search(arr, 8), None)
def test_search(self): arr = [1, 2, 3, 4, 5] self.assertEqual(search(arr, 5), 4) arr = [] self.assertEqual(search(arr, 5), None) arr = [1, 2, 3, 4, 5, 6] self.assertEqual(search(arr, 6), 5) arr = [1, 2, 3, 4, 5, 6] self.assertEqual(search(arr, 17), None) arr = [1, 2, 3, 4, 5, 6] self.assertEqual(search(arr, 2), 1)
def test_search_index_bounds(self): arr = [1, 2, 3, 4, 5] self.assertEqual(search(arr, 6), None)