mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-07-31 20:10:36 +02:00
add test
This commit is contained in:
@@ -18,6 +18,11 @@ module test_sort() {
|
||||
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;
|
||||
assert(sort([2, 1, 3, 5, 4], by = ascending) == [1, 2, 3, 4, 5]);
|
||||
|
Reference in New Issue
Block a user