1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-04-20 22:21:52 +02:00
This commit is contained in:
Justin Lin 2022-04-14 18:10:20 +08:00
parent 17c9118494
commit eccf2e2bd9

View File

@ -17,6 +17,11 @@ module test_sort() {
[[0, 2, 0], [0, 5, 0], [0, 7, 0], [0, 9, 0], [0, 10, 0]] ==
sort([[0, 10, 0], [0, 5, 0], [0, 7, 0], [0, 2, 0], [0, 9, 0]], by = "idx", idx = 1)
);
assert(
[[9, 0, 2], [2, 0, 3], [7, 0, 4], [5, 0, 5], [10, 0, 6]] ==
sort([[10, 0, 6], [5, 0, 5], [7, 0, 4], [2, 0, 3], [9, 0, 2]], by = "vt")
);
ascending = function(e1, e2) e1 - e2;
descending = function(e1, e2) e2 - e1;