1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/test/util/test_zip.scad
2021-02-24 14:33:56 +08:00

17 lines
366 B
OpenSCAD

use <util/zip.scad>;
use <util/sum.scad>;
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]]);
sum_up = function(elems) sum(elems);
assert(zip([xs, ys, zs], sum_up) == [17.5, 42.5, 67.4]);
}
test_zip();