示例#1
0
def test_wasteland_large_wastes_reverse():
    landmarks = [
        1,
        1,
        1,
        20,
        1,
        1,
        20,
        1,
        1,
        1,
        100,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
    ]
    ws.sort(landmarks, True)
    assert [100, 20, 20, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
            1] == landmarks
示例#2
0
def test_wasteland_large_wastes():
    landmarks = [
        1,
        1,
        1,
        20,
        1,
        1,
        20,
        1,
        1,
        1,
        100,
        1,
        1,
        1,
        1,
        1,
        1,
        1,
    ]
    ws.sort(landmarks, False)
    assert [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 20, 20,
            100] == landmarks
示例#3
0
def test_wasteland_reverse_empty():
    assert [] == ws.sort([], True)
示例#4
0
def test_wasteland_empty():
    assert [] == ws.sort([], False)
示例#5
0
def test_wasteland_already_sorted():
    landmarks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    ws.sort(landmarks, False)
    assert landmarks == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
示例#6
0
def test_wasteland_reverse_out_of_order():
    landmarks = [10, 9, 7, 4, 6, 2, 1, 5, 8, 3]
    ws.sort(landmarks, True)
    assert [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] == landmarks
示例#7
0
def test_wasteland_reverse_already_sorted():
    landmarks = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
    ws.sort(landmarks, True)
    assert landmarks == [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
示例#8
0
def test_wasteland_out_of_order():
    landmarks = [10, 9, 7, 4, 6, 2, 1, 5, 8, 3]
    ws.sort(landmarks, False)
    assert [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] == landmarks