import: hackage: Fix Cabal test.

* guix/import/hackage.scm (hackage->guix-package): Remove call to 'memoize'.
(hackage->guix-package/m): New procedure.
(hackage-recursive-import): Use it.
* tests/hackage.scm ("hackage->guix-package test 6"): Adjust.

Co-authored-by: Robert Vollmert <rob@vllmrt.net>
This commit is contained in:
Ludovic Courtès 2019-05-26 23:18:21 +02:00
parent 002d17dcaa
commit ad7466aafd
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 52 additions and 17 deletions

View file

@ -207,8 +207,41 @@ library
#:cabal-environment '(("impl" . "ghc-7.8"))))
(test-assert "hackage->guix-package test 6"
(eval-test-with-cabal test-cabal-6
#:cabal-environment '(("impl" . "ghc-7.8"))))
(mock
((guix import hackage) hackage-fetch
(lambda (name-version)
(call-with-input-string test-cabal-6
read-cabal)))
(match (hackage->guix-package "foo")
(('package
('name "ghc-foo")
('version "1.0.0")
('source
('origin
('method 'url-fetch)
('uri ('string-append
"https://hackage.haskell.org/package/foo/foo-"
'version
".tar.gz"))
('sha256
('base32
(? string? hash)))))
('build-system 'haskell-build-system)
('inputs
('quasiquote
(("ghc-b" ('unquote 'ghc-b))
("ghc-http" ('unquote 'ghc-http))
("ghc-mtl" ('unquote 'ghc-mtl)))))
('native-inputs
('quasiquote
(("ghc-haskell-gi" ('unquote 'ghc-haskell-gi)))))
('home-page "http://test.org")
('synopsis (? string?))
('description (? string?))
('license 'bsd-3))
#t)
(x
(pk 'fail x #f)))))
(test-assert "read-cabal test 1"
(match (call-with-input-string test-read-cabal-1 read-cabal)