1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-29 11:58:39 +01:00
dotSCAD/test/util/test_zip.scad

17 lines
364 B
OpenSCAD
Raw Normal View History

2022-06-06 13:11:46 +08:00
use <util/zip.scad>
use <util/sum.scad>
2021-02-11 11:29:16 +08:00
module test_zip() {
echo("==== test_zip ====");
xs = [10, 20, 30];
ys = [5, 15, 25];
zs = [2.5, 7.5, 12.4];
assert(zip([xs, ys, zs]) == [[10, 5, 2.5], [20, 15, 7.5], [30, 25, 12.4]]);
2021-02-11 11:45:28 +08:00
sum_up = function(elems) sum(elems);
assert(zip([xs, ys, zs], sum_up) == [17.5, 42.5, 67.4]);
2021-02-11 11:29:16 +08:00
}
test_zip();