mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-09-03 04:03:34 +02:00
add path.scad tests, shift tests to correct files
path_extrude2d bugfix
This commit is contained in:
@@ -113,6 +113,40 @@ module test_v_theta() {
|
||||
test_v_theta();
|
||||
|
||||
|
||||
module test_min_index() {
|
||||
vals = rands(-100,100,100,seed=75);
|
||||
minval = min(vals);
|
||||
minidx = min_index(vals);
|
||||
assert_equal(vals[minidx], minval);
|
||||
assert_equal(min_index([3,4,5,6]), 0);
|
||||
assert_equal(min_index([4,3,5,6]), 1);
|
||||
assert_equal(min_index([4,5,3,6]), 2);
|
||||
assert_equal(min_index([4,5,6,3]), 3);
|
||||
assert_equal(min_index([6,5,4,3]), 3);
|
||||
assert_equal(min_index([6,3,4,5]), 1);
|
||||
assert_equal(min_index([-56,72,-874,5]), 2);
|
||||
}
|
||||
test_min_index();
|
||||
|
||||
|
||||
module test_max_index() {
|
||||
vals = rands(-100,100,100,seed=97);
|
||||
maxval = max(vals);
|
||||
maxidx = max_index(vals);
|
||||
assert_equal(vals[maxidx], maxval);
|
||||
assert_equal(max_index([3,4,5,6]), 3);
|
||||
assert_equal(max_index([3,4,6,5]), 2);
|
||||
assert_equal(max_index([3,6,4,5]), 1);
|
||||
assert_equal(max_index([6,3,4,5]), 0);
|
||||
assert_equal(max_index([5,6,4,3]), 1);
|
||||
assert_equal(max_index([-56,72,-874,5]), 1);
|
||||
}
|
||||
test_max_index();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
module test_unit() {
|
||||
assert(unit([10,0,0]) == [1,0,0]);
|
||||
assert(unit([0,10,0]) == [0,1,0]);
|
||||
|
Reference in New Issue
Block a user