示例#1
0
def test_qsort():
    l1 = range(50)
    assert sorted(l1)
    l2 = l1[:]
    random.shuffle(l2)
    assert not sorted(l2)
    l3 = qsort(l2)
    assert sorted(l3)
    assert l3 == l1
示例#2
0
def test_qsort():
    l1 = range(50)
    assert sorted(l1)
    l2 = l1[:]
    random.shuffle(l2)
    assert not sorted(l2)
    l3 = qsort(l2)
    assert sorted(l3)
    assert l3 == l1
示例#3
0
def test_sorted():
    assert sorted([])
    assert sorted([1])
    assert sorted([1, 2])
    assert sorted([1, 2, 3])
    assert not sorted([2, 1])
    assert not sorted([3, 2, 1])
    assert not sorted([3, 1, 2])
示例#4
0
def test_sorted():
    assert sorted([])
    assert sorted([1])
    assert sorted([1, 2])
    assert sorted([1, 2, 3])
    assert not sorted([2, 1])
    assert not sorted([3, 2, 1])
    assert not sorted([3, 1, 2])