add couple list utils

list-split and list-join
This commit is contained in:
2025-10-21 21:20:33 +03:00
committed by Pavel Kulyov
parent ca7202924e
commit 036f82facf
3 changed files with 43 additions and 1 deletions

22
tests/utils.scm Normal file
View File

@@ -0,0 +1,22 @@
(test-group "utils"
(test
'((1) (2) (3))
(list-split '(1 * 2 * 3) '*))
(test
'((1 2 3))
(list-split '(1 2 3) '*))
(test
'(() (1) (2) (3) ())
(list-split '(* 1 * 2 * 3 *) '*))
(test
'((const) (const struct something))
(list-split '(const * const struct something) '*))
(test
'(1 * 2 * 3)
(list-join '(1 2 3) '*))
)