Пример #1
0
 def test_custom_binary_predicate_second(self):
     assert pyaoi.search_n(
         [(1, 2), (3, 4), (3, 4), (5, 6)],
         (3, 4),
         2,
         lambda x, y: x[0] == y[1] and x[1] == y[1],
     )
Пример #2
0
 def test_super_empty(self):
     assert pyaoi.search_n([], 10, 5) == -1
Пример #3
0
 def test_not_present(self):
     assert pyaoi.search_n([1, 2, 3, 4, 5], 6, 2) == -1
Пример #4
0
 def test_third(self):
     assert pyaoi.search_n([1, 2, 3, 4, 5], 3, 1) == 2
Пример #5
0
 def test_end(self):
     assert pyaoi.search_n([1, 2, 3, 4, 4, 4], 4, 2) == 3
Пример #6
0
 def test_beginning(self):
     assert pyaoi.search_n([1, 1, 1, 2, 3, 4, 5], 1, 2) == 0