diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-07-10 16:54:17 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-07-10 17:01:08 +0200 |
commit | fdc1bf659d9834fce6c78d31680b580eab3f4235 (patch) | |
tree | 647c4dc2bee902cffd64099db95b3fb57fe2986d /tests/records.scm | |
parent | c0edcc3c1926497919e6eefed32dbe5fdc55d045 (diff) | |
download | guix-fdc1bf659d9834fce6c78d31680b580eab3f4235.tar.gz |
records: Add `recutils->alist' for public consumption.
* guix/records.scm (%recutils-field-rx): New variable. (recutils->alist): New procedure, formerly known as `fields->alist'. * guix/scripts/substitute-binary.scm (fields->alist): Use it. * tests/records.scm ("recutils->alist"): New test.
Diffstat (limited to 'tests/records.scm')
-rw-r--r-- | tests/records.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/records.scm b/tests/records.scm index 9e524b670c..470644451c 100644 --- a/tests/records.scm +++ b/tests/records.scm @@ -131,6 +131,23 @@ (parameterize ((mark (cons 'a 'b))) (eq? (foo-baz y) (mark)))))))) +(test-equal "recutils->alist" + '((("Name" . "foo") + ("Version" . "0.1") + ("Synopsis" . "foo bar") + ("Something_else" . "chbouib")) + (("Name" . "bar") + ("Version" . "1.5"))) + (let ((p (open-input-string "Name: foo +Version: 0.1 +Synopsis: foo bar +Something_else: chbouib + +Name: bar +Version: 1.5"))) + (list (recutils->alist p) + (recutils->alist p)))) + (test-end) |