Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit fd2c073bb2, reversing
changes made to d4c7fab7ed.
This commit is contained in:
RonaldoCMP
2021-04-05 15:59:54 +01:00
parent 407c36a8ae
commit 2c03b19246
12 changed files with 53 additions and 115 deletions

View File

@@ -27,6 +27,21 @@ module test_select() {
}
test_select();
module test_last() {
list = [1,2,3,4];
assert(last(list)==4);
assert(last([])==undef);
}
test_last();
module test_delete_last() {
list = [1,2,3,4];
assert(delete_last(list) == [1,2,3]);
assert(delete_last([1]) == []);
assert(delete_last([]) == []);
}
test_delete_last();
module test_slice() {
assert(slice([3,4,5,6,7,8,9], 3, 5) == [6,7]);
@@ -39,42 +54,6 @@ module test_slice() {
test_slice();
module test_last() {
list = [1,2,3,4];
assert(last(list)==4);
assert(last([])==undef);
}
test_last();
module test_list_head() {
list = [1,2,3,4];
assert_equal(list_head(list), [1,2,3]);
assert_equal(list_head([1]), []);
assert_equal(list_head([]), []);
assert_equal(list_head(list,-3), [1,2]);
assert_equal(list_head(list,1), [1,2]);
assert_equal(list_head(list,2), [1,2,3]);
assert_equal(list_head(list,6), [1,2,3,4]);
assert_equal(list_head(list,-6), []);
}
test_list_head();
module test_list_tail() {
list = [1,2,3,4];
assert_equal(list_tail(list), [2,3,4]);
assert_equal(list_tail([1]), []);
assert_equal(list_tail([]), []);
assert_equal(list_tail(list,-3), [2,3,4]);
assert_equal(list_tail(list,2), [3,4]);
assert_equal(list_tail(list,3), [4]);
assert_equal(list_tail(list,6), []);
assert_equal(list_tail(list,-6), [1,2,3,4]);
}
test_list_tail();
module test_in_list() {
assert(in_list("bar", ["foo", "bar", "baz"]));
assert(!in_list("bee", ["foo", "bar", "baz"]));