1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-13 02:04:16 +02:00

add slice

This commit is contained in:
Justin Lin
2019-06-24 20:05:58 +08:00
parent 53a69477d6
commit 912adba419
3 changed files with 20 additions and 0 deletions

15
test/util/test_slice.scad Normal file
View File

@@ -0,0 +1,15 @@
module test_slice() {
echo("==== test_slice ====");
include <unittest.scad>;
include <util/slice.scad>;
lt = [for(c = "helloworld") c];
expected1 = [for(c = "hello") c];
expected2 = [for(c = "world") c];
assert(expected1 == slice(lt, 0, 5));
assert(expected2 == slice(lt, 5));
}
test_slice();