mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-09-11 14:06:13 +03:00
Add some regression tests for sortBy
to test stability of the sort.
This commit is contained in:
parent
3b62788841
commit
9b7e60b9f4
4
tests/regression/sort.icry
Normal file
4
tests/regression/sort.icry
Normal file
@ -0,0 +1,4 @@
|
||||
sortBy (\x y -> x.0 ==> y.0) [(True, 0x1), (False, 0x2), (True, 0x3), (False, 0x4)]
|
||||
[ ((n * n) % 23 : Integer, n) | n <- [0..22] ]
|
||||
sortBy (\x y -> x.0 <= y.0) it
|
||||
sortBy (\x y -> x.1 >= y.1) it
|
14
tests/regression/sort.icry.stdout
Normal file
14
tests/regression/sort.icry.stdout
Normal file
@ -0,0 +1,14 @@
|
||||
Loading module Cryptol
|
||||
[(False, 0x2), (False, 0x4), (True, 0x1), (True, 0x3)]
|
||||
[(0, 0), (1, 1), (4, 2), (9, 3), (16, 4), (2, 5), (13, 6), (3, 7),
|
||||
(18, 8), (12, 9), (8, 10), (6, 11), (6, 12), (8, 13), (12, 14),
|
||||
(18, 15), (3, 16), (13, 17), (2, 18), (16, 19), (9, 20), (4, 21),
|
||||
(1, 22)]
|
||||
[(0, 0), (1, 1), (1, 22), (2, 5), (2, 18), (3, 7), (3, 16), (4, 2),
|
||||
(4, 21), (6, 11), (6, 12), (8, 10), (8, 13), (9, 3), (9, 20),
|
||||
(12, 9), (12, 14), (13, 6), (13, 17), (16, 4), (16, 19), (18, 8),
|
||||
(18, 15)]
|
||||
[(1, 22), (4, 21), (9, 20), (16, 19), (2, 18), (13, 17), (3, 16),
|
||||
(18, 15), (12, 14), (8, 13), (6, 12), (6, 11), (8, 10), (12, 9),
|
||||
(18, 8), (3, 7), (13, 6), (2, 5), (16, 4), (9, 3), (4, 2), (1, 1),
|
||||
(0, 0)]
|
Loading…
Reference in New Issue
Block a user