Resolved conflicts with master.

This commit is contained in:
Garth Minette
2021-04-06 19:18:57 -07:00
parent bda2661855
commit 698268c8c7
12 changed files with 107 additions and 61 deletions

View File

@@ -48,24 +48,33 @@ module test_last() {
}
test_last();
module test_delete_last() {
module test_list_head() {
list = [1,2,3,4];
assert(delete_last(list) == [1,2,3]);
assert(delete_last([1]) == []);
assert(delete_last([]) == []);
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_delete_last();
test_list_head();
module test_slice() {
assert(slice([3,4,5,6,7,8,9], 3, 5) == [6,7]);
assert(slice([3,4,5,6,7,8,9], 2, -1) == [5,6,7,8,9]);
assert(slice([3,4,5,6,7,8,9], 1, 1) == []);
assert(slice([3,4,5,6,7,8,9], 6, -1) == [9]);
assert(slice([3,4,5,6,7,8,9], 2, -2) == [5,6,7,8]);
assert(slice([], 2, -2) == []);
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_slice();
test_list_tail();
module test_in_list() {