summaryrefslogtreecommitdiff
path: root/tests/hackage.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-05-26 23:18:21 +0200
committerLudovic Courtès <ludo@gnu.org>2019-05-26 23:20:30 +0200
commitad7466aafd7f166d0b6be5eb32dda1d3ee8a6445 (patch)
tree5984728bf94a6b3cb11140b9bb986c573cf59d05 /tests/hackage.scm
parent002d17dcaacba0f86265b34f2509419d9e21224d (diff)
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>
Diffstat (limited to 'tests/hackage.scm')
-rw-r--r--tests/hackage.scm37
1 files changed, 35 insertions, 2 deletions
diff --git a/tests/hackage.scm b/tests/hackage.scm
index e17851a213b..0efad0638d2 100644
--- a/tests/hackage.scm
+++ b/tests/hackage.scm
@@ -207,8 +207,41 @@ library
207 #:cabal-environment '(("impl" . "ghc-7.8")))) 207 #:cabal-environment '(("impl" . "ghc-7.8"))))
208 208
209(test-assert "hackage->guix-package test 6" 209(test-assert "hackage->guix-package test 6"
210 (eval-test-with-cabal test-cabal-6 210 (mock
211 #:cabal-environment '(("impl" . "ghc-7.8")))) 211 ((guix import hackage) hackage-fetch
212 (lambda (name-version)
213 (call-with-input-string test-cabal-6
214 read-cabal)))
215 (match (hackage->guix-package "foo")
216 (('package
217 ('name "ghc-foo")
218 ('version "1.0.0")
219 ('source
220 ('origin
221 ('method 'url-fetch)
222 ('uri ('string-append
223 "https://hackage.haskell.org/package/foo/foo-"
224 'version
225 ".tar.gz"))
226 ('sha256
227 ('base32
228 (? string? hash)))))
229 ('build-system 'haskell-build-system)
230 ('inputs
231 ('quasiquote
232 (("ghc-b" ('unquote 'ghc-b))
233 ("ghc-http" ('unquote 'ghc-http))
234 ("ghc-mtl" ('unquote 'ghc-mtl)))))
235 ('native-inputs
236 ('quasiquote
237 (("ghc-haskell-gi" ('unquote 'ghc-haskell-gi)))))
238 ('home-page "http://test.org")
239 ('synopsis (? string?))
240 ('description (? string?))
241 ('license 'bsd-3))
242 #t)
243 (x
244 (pk 'fail x #f)))))
212 245
213(test-assert "read-cabal test 1" 246(test-assert "read-cabal test 1"
214 (match (call-with-input-string test-read-cabal-1 read-cabal) 247 (match (call-with-input-string test-read-cabal-1 read-cabal)