diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-01-06 22:42:09 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-01-06 23:08:22 +0100 |
commit | 6071122b713e8a87158cdd4e913851fab283ead3 (patch) | |
tree | 68f763513ee1a9ed494f8489ff18cf6169f62640 /tests/utils.scm | |
parent | 793a43f4099c94a74fa3374b0ed732cb14e120e9 (diff) | |
download | guix-6071122b713e8a87158cdd4e913851fab283ead3.tar guix-6071122b713e8a87158cdd4e913851fab283ead3.tar.gz |
utils: Add 'ensure-keyword-arguments'.
* guix/utils.scm (delkw, ensure-keyword-arguments): New procedures.
* tests/utils.scm ("ensure-keyword-arguments"): New test.
Diffstat (limited to 'tests/utils.scm')
-rw-r--r-- | tests/utils.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/utils.scm b/tests/utils.scm index 04a859fc9d..a05faabc15 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org> ;;; ;;; This file is part of GNU Guix. @@ -141,6 +141,14 @@ '(a #:foo 42 #:b b #:baz 3 #:c c #:bar 4))) +(test-equal "ensure-keyword-arguments" + '((#:foo 2) + (#:foo 2 #:bar 3) + (#:foo 42 #:bar 3)) + (list (ensure-keyword-arguments '(#:foo 2) '(#:foo 2)) + (ensure-keyword-arguments '(#:foo 2) '(#:bar 3)) + (ensure-keyword-arguments '(#:foo 2) '(#:bar 3 #:foo 42)))) + (let* ((tree (alist->vhash '((0 2 3) (1 3 4) (2) (3 5 6) (4 6) (5) (6)) hashq)) |