mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
update test_math
This commit is contained in:
parent
d18f558c1a
commit
0b38bc463f
1 changed files with 6 additions and 0 deletions
|
@ -546,7 +546,9 @@ test_sum_of_sines();
|
|||
|
||||
module test_deltas() {
|
||||
assert_equal(deltas([2,5,9,17]), [3,4,8]);
|
||||
assert_equal(deltas([2,5,9,17],wrap=true), [3,4,8,-15]);
|
||||
assert_equal(deltas([[1,2,3], [3,6,8], [4,8,11]]), [[2,4,5], [1,2,3]]);
|
||||
assert_equal(deltas([[1,2,3], [3,6,8], [4,8,11]],wrap=true), [[2,4,5], [1,2,3], [-3,-6,-8]]);
|
||||
}
|
||||
test_deltas();
|
||||
|
||||
|
@ -582,6 +584,10 @@ module test_convolve() {
|
|||
assert_equal(convolve([1,1],[]), []);
|
||||
assert_equal(convolve([1,1],[1,2,1]), [1,3,3,1]);
|
||||
assert_equal(convolve([1,2,3],[1,2,1]), [1,4,8,8,3]);
|
||||
assert_equal(convolve([1,2,3],[[1],[2],[1]]), [[1], [4], [8], [8], [3]]);
|
||||
assert_equal(convolve([[1],[2],[3]],[[1],[2],[1]]), [1,4,8,8,3]);
|
||||
assert_equal(convolve([[1,0],[2,1],[3,2]],[[1,0],[2,1],[1,2]]), [1,4,9,12,7]);
|
||||
assert_equal(convolve([1,2,3],[[1,0],[2,1],[1,2]]), [[1,0],[4,1],[8,4],[8,7],[3,6]]);
|
||||
}
|
||||
test_convolve();
|
||||
|
||||
|
|
Loading…
Reference in a new issue