mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-12 11:54:14 +02:00
Fix bug. Add test for subindex.
This commit is contained in:
@@ -358,6 +358,7 @@ test_add_scalar();
|
||||
module test_subindex() {
|
||||
v = [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]];
|
||||
assert(subindex(v,2) == [3, 7, 11, 15]);
|
||||
assert(subindex(v,[2]) == [[3], [7], [11], [15]]);
|
||||
assert(subindex(v,[2,1]) == [[3, 2], [7, 6], [11, 10], [15, 14]]);
|
||||
assert(subindex(v,[1:3]) == [[2, 3, 4], [6, 7, 8], [10, 11, 12], [14, 15, 16]]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user