Esempio n. 1
0
def test_unidimensional_peak_finder_second_half():
    l = [0, 1, 2, 3, 4, 5, 6, 7, 2, 0]
    res = unidimensional_peak_finder(l)
    assert res == 7, \
            f"Found on position: {res}, while 'input': {l}"
Esempio n. 2
0
def test_unidimensional_peak_finder_three_element_list():
    l = [1, 3, 2]
    res = unidimensional_peak_finder(l)
    assert res == 1, \
            f"Found on position: {res}, while 'input': {l}"
Esempio n. 3
0
def test_unidimensional_peak_finder_last_element():
    l = [13, 14, 15, 16, 17, 18]
    res = unidimensional_peak_finder(l)
    assert res == 5, \
            f"Found on position: {res}, while 'input': {l}"
Esempio n. 4
0
def test_unidimensional_peak_finder_first_element():
    l = [24, 23, 22, 21, 20,  7]
    res = unidimensional_peak_finder(l)
    assert res == 0, \
            f"Found on position: {res}, while 'input': {l}"
Esempio n. 5
0
def test_unidimensional_peak_finder_first_half():
    l = [0, 1, 7, 4, 3, 2, 0]
    res = unidimensional_peak_finder(l)
    assert res == 2, \
            f"Found on position: {res}, while 'input': {l}"