summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-07-10 16:54:17 +0200
committerLudovic Courtès <ludo@gnu.org>2013-07-10 17:01:08 +0200
commitfdc1bf659d9834fce6c78d31680b580eab3f4235 (patch)
tree647c4dc2bee902cffd64099db95b3fb57fe2986d /tests
parentc0edcc3c1926497919e6eefed32dbe5fdc55d045 (diff)
downloadpatches-fdc1bf659d9834fce6c78d31680b580eab3f4235.tar
patches-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')
-rw-r--r--tests/records.scm17
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)