Add simple reverse sort test
This commit is contained in:
parent
34f8515d44
commit
84203501a5
13
test/testSortReverse.krk
Normal file
13
test/testSortReverse.krk
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import random
|
||||||
|
def __main__(a,n=50000):
|
||||||
|
for j in range(n):
|
||||||
|
a.append(random.random())
|
||||||
|
a.append(42) # Forces heterogynous sorting in CPython
|
||||||
|
a.sort()
|
||||||
|
for j in range(n):
|
||||||
|
assert(a[j] <= a[j+1])
|
||||||
|
a.sort(reverse=True)
|
||||||
|
for j in range(n):
|
||||||
|
assert(a[j] >= a[j+1])
|
||||||
|
|
||||||
|
__main__([])
|
0
test/testSortReverse.krk.expect
Normal file
0
test/testSortReverse.krk.expect
Normal file
Loading…
Reference in New Issue
Block a user