aboutsummaryrefslogtreecommitdiff
path: root/tests/opam.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-05-31 23:50:06 +0200
committerLudovic Courtès <ludo@gnu.org>2023-05-31 23:50:06 +0200
commit654fcf9971bb01389d577be07c6ec0f68940c743 (patch)
tree59ff22f02c9b265adc4b8f596b9924b586895248 /tests/opam.scm
parent9f7cd1fcaf99c8e8430d0b29335220701664dc54 (diff)
downloadguix-654fcf9971bb01389d577be07c6ec0f68940c743.tar
guix-654fcf9971bb01389d577be07c6ec0f68940c743.tar.gz
tests: Use quasiquoted 'match' patterns for package sexps.
Turns out it's easier to read. * tests/cpan.scm ("cpan->guix-package"): Use a quasiquoted pattern. * tests/elpa.scm (eval-test-with-elpa): Likewise. * tests/gem.scm ("gem->guix-package") ("gem->guix-package with a specific version") ("gem-recursive-import") ("gem-recursive-import with a specific version"): Likewise. * tests/hexpm.scm ("hexpm-recursive-import"): Likewise. * tests/opam.scm ("opam->guix-package"): Likewise. * tests/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, wheels") ("pypi->guix-package, no usable requirement file.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Likewise. * tests/texlive.scm ("texlive->guix-package"): Likewise.
Diffstat (limited to 'tests/opam.scm')
-rw-r--r--tests/opam.scm33
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/opam.scm b/tests/opam.scm
index b5f02f809b..832fea1d9b 100644
--- a/tests/opam.scm
+++ b/tests/opam.scm
@@ -92,23 +92,22 @@ url {
(lambda _
(format #t "~a" test-opam-file))))
(match (opam->guix-package "foo" #:repo (list test-repo))
- (('package
- ('name "ocaml-foo")
- ('version "1.0.0")
- ('source ('origin
- ('method 'url-fetch)
- ('uri "https://example.org/foo-1.0.0.tar.gz")
- ('sha256
- ('base32
- (? string? hash)))))
- ('build-system 'ocaml-build-system)
- ('propagated-inputs ('list 'ocaml-zarith))
- ('native-inputs
- ('list 'ocaml-alcotest 'ocamlbuild))
- ('home-page "https://example.org/")
- ('synopsis "Some example package")
- ('description "This package is just an example.")
- ('license 'license:bsd-3))
+ (`(package
+ (name "ocaml-foo")
+ (version "1.0.0")
+ (source (origin
+ (method url-fetch)
+ (uri "https://example.org/foo-1.0.0.tar.gz")
+ (sha256
+ (base32 ,(? string? hash)))))
+ (build-system ocaml-build-system)
+ (propagated-inputs (list ocaml-zarith))
+ (native-inputs
+ (list ocaml-alcotest ocamlbuild))
+ (home-page "https://example.org/")
+ (synopsis "Some example package")
+ (description "This package is just an example.")
+ (license license:bsd-3))
(string=? (bytevector->nix-base32-string
test-source-hash)
hash))