Added regressions for permute() and repeat_entries()

This commit is contained in:
Revar Desmera 2020-01-16 13:01:41 -08:00
parent be8b30974a
commit 68260afebb
2 changed files with 17 additions and 1 deletions

View file

@ -294,6 +294,22 @@ module test_triplet_wrap() {
test_triplet_wrap();
module test_permute() {
assert(permute([3,4,5,6]) == [[3,4],[3,5],[3,6],[4,5],[4,6],[5,6]]);
assert(permute([3,4,5,6],n=3) == [[3,4,5],[3,4,6],[3,5,6],[4,5,6]]);
}
test_permute();
module test_repeat_entries() {
list = [0,1,2,3];
assert(repeat_entries(list, 6) == [0,0,1,2,2,3]);
assert(repeat_entries(list, 6, exact=false) == [0,0,1,1,2,2,3,3]);
assert(repeat_entries(list, [1,1,2,1], exact=false) == [0,1,2,2,3]);
}
test_repeat_entries();
module test_zip() {
v1 = [1,2,3,4];
v2 = [5,6,7];

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,90];
BOSL_VERSION = [2,0,91];
// Section: BOSL Library Version Functions