Beispiel #1
0
def test_counting_sort_empty():
    data = []
    expected = []
    output = sort.counting_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Beispiel #2
0
def test_counting_sort_unsorted_even():
    data = [4, 2, 6, 1]
    expected = [1, 2, 4, 6]
    output = sort.counting_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Beispiel #3
0
def test_counting_sort_unsorted_odd():
    data = [7, 8, 3, 5, 5]
    expected = [3, 5, 5, 7, 8]
    output = sort.counting_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)
Beispiel #4
0
def test_counting_sort_sorted_odd():
    data = [1, 2, 3]
    expected = [1, 2, 3]
    output = sort.counting_sort(data)
    assert (output == expected), "Got: {}; Expected: {}".format(
        output, expected)