summaryrefslogtreecommitdiff
path: root/tests/utils.scm
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2016-09-01 08:20:25 -0500
committerEric Bavier <bavier@member.fsf.org>2016-10-07 07:41:57 -0500
commit347df60158a11abbc9b84ac36cd113362d7e09e0 (patch)
treed4422b64e96438bf6dd17779f7ccd4609d02351f /tests/utils.scm
parentfb29e737d49a18d95588a820c048829096d921d1 (diff)
downloadpatches-347df60158a11abbc9b84ac36cd113362d7e09e0.tar
patches-347df60158a11abbc9b84ac36cd113362d7e09e0.tar.gz
utils: Fix default-keyword-arguments.
* guix/utils.scm (default-keyword-arguments): Properly test for present keywords. * tests/utils.scm (default-keyword-arguments): New test.
Diffstat (limited to 'tests/utils.scm')
-rw-r--r--tests/utils.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/utils.scm b/tests/utils.scm
index 6590ed91cf..960928c842 100644
--- a/tests/utils.scm
+++ b/tests/utils.scm
@@ -111,6 +111,18 @@
(ensure-keyword-arguments '(#:foo 2) '(#:bar 3))
(ensure-keyword-arguments '(#:foo 2) '(#:bar 3 #:foo 42))))
+(test-equal "default-keyword-arguments"
+ '((#:foo 2)
+ (#:foo 2)
+ (#:foo 2 #:bar 3)
+ (#:foo 2 #:bar 3)
+ (#:foo 2 #:bar 3))
+ (list (default-keyword-arguments '() '(#:foo 2))
+ (default-keyword-arguments '(#:foo 2) '(#:foo 4))
+ (default-keyword-arguments '() '(#:bar 3 #:foo 2))
+ (default-keyword-arguments '(#:bar 3) '(#:foo 2))
+ (default-keyword-arguments '(#:foo 2 #:bar 3) '(#:bar 6))))
+
(test-assert "filtered-port, file"
(let* ((file (search-path %load-path "guix.scm"))
(input (open-file file "r0b")))