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.
This commit is contained in:
Ludovic Courtès 2020-01-16 21:47:36 +01:00
parent 72c678af55
commit cfd1ed8401
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 11 additions and 4 deletions

View file

@ -54,7 +54,10 @@ (define-module (guix import cran)
cran-package?
bioconductor-package?
bioconductor-data-package?
bioconductor-experiment-package?))
bioconductor-experiment-package?
description->alist
description->package))
;;; Commentary:
;;;
@ -270,6 +273,10 @@ (define (listify meta field)
(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"

View file

@ -53,7 +53,7 @@ (define description "
")
(define description-alist
((@@ (guix import cran) description->alist) description))
(description->alist description))
(define simple-alist
'(("Key" . "Value")
@ -72,7 +72,7 @@ (define simple-alist
"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 @@ (define simple-alist
("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")