mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-09-01 23:12:47 +02:00
change count_true to num_true and simplify
fix bug in offset()
This commit is contained in:
@@ -448,22 +448,6 @@ module test_all() {
|
||||
test_all();
|
||||
|
||||
|
||||
module test_count_true() {
|
||||
assert_equal(count_true([0,false,undef]), 0);
|
||||
assert_equal(count_true([1,false,undef]), 1);
|
||||
assert_equal(count_true([1,5,false]), 2);
|
||||
assert_equal(count_true([1,5,true]), 3);
|
||||
assert_equal(count_true([[0,0], [0,0]]), 2);
|
||||
assert_equal(count_true([[0,0], [1,0]]), 2);
|
||||
assert_equal(count_true([[1,1], [1,1]]), 2);
|
||||
assert_equal(count_true([1,1,1,1,1], nmax=3), 3);
|
||||
assert_equal(count_true([1,3,5,7,9], function (a) a%2==0),0);
|
||||
assert_equal(count_true([1,3,6,8,9], function (a) a%2==0),2);
|
||||
assert_equal(count_true([1,3,5,7,9], function (a) a%2!=0),5);
|
||||
}
|
||||
test_count_true();
|
||||
|
||||
|
||||
module test_factorial() {
|
||||
assert_equal(factorial(0), 1);
|
||||
assert_equal(factorial(1), 1);
|
||||
|
Reference in New Issue
Block a user