mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-20 21:41:41 +02:00
add tests
This commit is contained in:
28
test/util/test_flat.scad
Normal file
28
test/util/test_flat.scad
Normal file
@@ -0,0 +1,28 @@
|
||||
use <util/flat.scad>;
|
||||
|
||||
module test_flat() {
|
||||
echo("==== test_flat ====");
|
||||
vt = [[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]];
|
||||
|
||||
assert(
|
||||
flat([1, 2, [3, 4]]) == [1, 2, 3, 4]
|
||||
);
|
||||
|
||||
assert(
|
||||
flat([[1, 2], [3, 4]]) == [1, 2, 3, 4]
|
||||
);
|
||||
|
||||
assert(
|
||||
flat([[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]]) == [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
|
||||
);
|
||||
|
||||
assert(
|
||||
flat([[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]], 2) == [[1, 2], [3, 4], [5, 6], [7, 8]]
|
||||
);
|
||||
|
||||
assert(
|
||||
flat([[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]], 3) == [1, 2, 3, 4, 5, 6, 7, 8]
|
||||
);
|
||||
}
|
||||
|
||||
test_flat();
|
Reference in New Issue
Block a user