Esempio n. 1
0
def test_bubble_sort_empty():
    data = []
    expected = []
    output = sort.bubble_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Esempio n. 2
0
def test_bubble_sort_single():
    data = [-1]
    expected = [-1]
    output = sort.bubble_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Esempio n. 3
0
def test_bubble_sort_unsorted_even():
    data = [4, 2, 6, 1]
    expected = [1, 2, 4, 6]
    output = sort.bubble_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Esempio n. 4
0
def test_bubble_sort_unsorted_odd():
    data = [7, 8, 3, 5, 5]
    expected = [3, 5, 5, 7, 8]
    output = sort.bubble_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Esempio n. 5
0
def test_bubble_sort_sorted_odd():
    data = [1, 2, 3]
    expected = [1, 2, 3]
    output = sort.bubble_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)