Пример #1
0
def test_bubble_sort():
    """
    make sure bubble_sort works correctly
    """

    assert sorting.bubble_sort([3, 2, 1]) == [1, 2, 3], 'incorrect'
    assert sorting.bubble_sort([5, 7, 9, 1]) == [1, 5, 7, 9], 'incorrect'
    assert sorting.bubble_sort([-1, -5, 4, 0, -7]) == [-7, -5, -1, 0,
                                                       4], 'incorrect'
Пример #2
0
def test_bubble_sort():
        '''
        Ensures that buble_sort function works.
        '''

        assert sorting.bubble_sort([5,4,3,2,1])==[1,2,3,4,5],'incorrect'
Пример #3
0
def test_bubble_sort():
    assert sorting.bubble_sort([8, 3, 2, 7, 4]) == [2, 3, 4, 7, 8], 'Correct'
    assert sorting.bubble_sort([19, 3, 2, 7, 4, 45,
                                9]) == [2, 3, 4, 7, 9, 19, 45], 'Correct'
Пример #4
0
def test_bubble_sort(n):
    '''Test to see if bubble sort sorts correctly'''
    assert sorting.bubble_sort([1,8,79,5,8,9]) == [1, 5, 8, 8, 9, 79]
    assert sorting.bubble_sort([5,8,9,7,4,5]) == [4, 5, 5, 7, 8, 9]
Пример #5
0
def test_bubble_sort():
            assert sorting.bubble_sort([8, 3, 2, 7, 4]) == [2,3,4,7,8], 'incorrect'
            assert sorting.bubble_sort([10, 1, 12, 9, 2]) == [1,2,9,10,12], 'incorrect'
            assert sorting.bubble_sort([2, 6, 1, 4, 5]) == [1,2,4,5,6], 'incorrect'