Files
leetcode/problems/0704-binary-search/solution_test.py
T

14 lines
298 B
Python

import pytest
from solution import Solution
@pytest.mark.parametrize(
"nums, target, expected",
[
([-1, 0, 3, 5, 9, 12], 9, 4),
([-1, 0, 3, 5, 9, 12], -2, -1),
],
)
def test_binary_search(nums, target, expected):
assert Solution().search(nums, target) == expected