diff options
Diffstat (limited to 'tvix/eval/src')
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.exp | 1 | ||||
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.nix | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.exp new file mode 100644 index 000000000000..9d783762143e --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.exp @@ -0,0 +1 @@ +[ { index = 7; key = 0; } { index = 0; key = 1; } { index = 13; key = 1; } { index = 1; key = 2; } { index = 3; key = 2; } { index = 4; key = 2; } { index = 5; key = 2; } { index = 12; key = 2; } { index = 14; key = 2; } { index = 2; key = 3; } { index = 11; key = 3; } { index = 15; key = 3; } { index = 10; key = 4; } { index = 6; key = 5; } { index = 8; key = 5; } { index = 9; key = 5; } { index = 16; key = 22; } ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.nix new file mode 100644 index 000000000000..9969e0a29433 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-stable-sort.nix @@ -0,0 +1,7 @@ +let + keys = [ 1 2 3 2 2 2 5 0 5 5 4 3 2 1 2 3 22 ]; +in + +builtins.sort + (a: b: a.key < b.key) + (builtins.genList (index: { inherit index; key = builtins.elemAt keys index; }) (builtins.length keys)) |