[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/05: import: cran: Avoid uses of '@@' in the tests.
From: |
guix-commits |
Subject: |
03/05: import: cran: Avoid uses of '@@' in the tests. |
Date: |
Thu, 16 Jan 2020 17:14:25 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit cfd1ed84013df85f0e473884ef4038b4bd7120d4
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Jan 16 21:47:36 2020 +0100
import: cran: Avoid uses of '@@' in the tests.
* guix/import/cran.scm (description->alist, description->package): Export.
<top level>: Set! 'listify'.
* tests/cran.scm (description-alist, "description->package"): Remove use
of '@@' to access the relevant bindings.
---
guix/import/cran.scm | 9 ++++++++-
tests/cran.scm | 6 +++---
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 13771ec..bcb37ed 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -54,7 +54,10 @@
cran-package?
bioconductor-package?
bioconductor-data-package?
- bioconductor-experiment-package?))
+ bioconductor-experiment-package?
+
+ description->alist
+ description->package))
;;; Commentary:
;;;
@@ -270,6 +273,10 @@ empty list when the FIELD cannot be found."
(string-any char-set:whitespace item)))
(map string-trim-both items))))))
+;; Trick Guile 3 so that it keeps the 'listify' binding accessible *and*
+;; private even though this module is declarative.
+(set! listify listify)
+
(define default-r-packages
(list "base"
"compiler"
diff --git a/tests/cran.scm b/tests/cran.scm
index d785ec5..70d2277 100644
--- a/tests/cran.scm
+++ b/tests/cran.scm
@@ -53,7 +53,7 @@ Date/Publication: 2015-07-14 14:15:16
")
(define description-alist
- ((@@ (guix import cran) description->alist) description))
+ (description->alist description))
(define simple-alist
'(("Key" . "Value")
@@ -72,7 +72,7 @@ Date/Publication: 2015-07-14 14:15:16
"Date/Publication")))
(lset= string=? keys (map car description-alist))))
-(test-equal "listify: return empty list if key cannot be found"
+(test-equal "listifyx: return empty list if key cannot be found"
'()
((@@ (guix import cran) listify) simple-alist "Letters"))
@@ -105,7 +105,7 @@ Date/Publication: 2015-07-14 14:15:16
("mirror://cran/src/contrib/My-Example_1.2.3.tar.gz"
"source")
(_ (error "Unexpected URL: " url))))))))
- (match ((@@ (guix import cran) description->package) 'cran
description-alist)
+ (match (description->package 'cran description-alist)
(('package
('name "r-my-example")
('version "1.2.3")