diff options
author | David Thompson <dthompson2@worcester.edu> | 2015-10-09 12:10:47 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2015-10-09 12:17:01 -0400 |
commit | bbd00d2012833c6419a62f6490cbef3e896b1e11 (patch) | |
tree | 6a5042c85949122419ff91e38455131eed04336b /tests/utils.scm | |
parent | b94ef11a538e19900c1f570500ac4dee73543844 (diff) | |
download | gnu-guix-bbd00d2012833c6419a62f6490cbef3e896b1e11.tar gnu-guix-bbd00d2012833c6419a62f6490cbef3e896b1e11.tar.gz |
utils: Add split procedure.
* guix/utils.scm (split): New procedure.
* tests/utils.scm: Add tests.
Diffstat (limited to 'tests/utils.scm')
-rw-r--r-- | tests/utils.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm index 115868c857..b65d6d20ba 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -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) |