1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 13:10:33 +02:00

utils: Add split procedure.

* guix/utils.scm (split): New procedure.
* tests/utils.scm: Add tests.
This commit is contained in:
David Thompson
2015-10-09 12:10:47 -04:00
parent b94ef11a53
commit bbd00d2012
2 changed files with 33 additions and 0 deletions

View File

@@ -121,6 +121,20 @@
'(0 1 2 3)))
list))
(test-equal "split, element is in list"
'((foo) (baz))
(call-with-values
(lambda ()
(split '(foo bar baz) 'bar))
list))
(test-equal "split, element is not in list"
'((foo bar baz) ())
(call-with-values
(lambda ()
(split '(foo bar baz) 'quux))
list))
(test-equal "strip-keyword-arguments"
'(a #:b b #:c c)
(strip-keyword-arguments '(#:foo #:bar #:baz)