Correction of is_vector and doc text

This commit is contained in:
RonaldoCMP
2020-07-28 19:02:35 +01:00
parent c10a8b919d
commit ab57790c27
4 changed files with 51 additions and 13 deletions

View File

@@ -3,6 +3,14 @@ include <../std.scad>
// Section: List Query Operations
module test_is_simple_list() {
assert(is_simple_list([1,2,3,4]));
assert(is_simple_list([]));
assert(!is_simple_list([1,2,[3,4]]));
}
test_is_simple_list();
module test_select() {
l = [3,4,5,6,7,8,9];
assert(select(l, 5, 6) == [8,9]);
@@ -434,10 +442,18 @@ test_array_group();
module test_flatten() {
assert(flatten([[1,2,3], [4,5,[6,7,8]]]) == [1,2,3,4,5,[6,7,8]]);
assert(flatten([]) == []);
}
test_flatten();
module test_full_flatten() {
assert(full_flatten([[1,2,3], [4,5,[6,[7],8]]]) == [1,2,3,4,5,6,7,8]);
assert(full_flatten([]) == []);
}
test_full_flatten();
module test_array_dim() {
assert(array_dim([[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]]) == [2,2,3]);
assert(array_dim([[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]], 0) == 2);