diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-09-07 11:04:44 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-09-07 14:19:08 +0200 |
commit | d9dfbf886ddbb92dfdaa118bb9765e78aad5c53a (patch) | |
tree | 2732020de20a38c09b66a60b0cb36022799f7c2e /tests/opam.scm | |
parent | b949f34f31a045eb0fb242b81a223178fb6994d3 (diff) | |
parent | 49922efb11da0f0e9d4f5979d081de5ea8c99d25 (diff) | |
download | guix-d9dfbf886ddbb92dfdaa118bb9765e78aad5c53a.tar guix-d9dfbf886ddbb92dfdaa118bb9765e78aad5c53a.tar.gz |
Merge branch 'master' into core-updates-frozen
Diffstat (limited to 'tests/opam.scm')
-rw-r--r-- | tests/opam.scm | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/tests/opam.scm b/tests/opam.scm index e7f1ff9e39..f2e9a7103c 100644 --- a/tests/opam.scm +++ b/tests/opam.scm @@ -83,36 +83,34 @@ url { (set! test-source-hash (call-with-input-file file-name port-sha256)))) (_ (error "Unexpected URL: " url))))) - (mock ((guix import opam) get-opam-repository - (const test-repo)) - (let ((my-package (string-append test-repo - "/packages/foo/foo.1.0.0"))) - (mkdir-p my-package) - (with-output-to-file (string-append my-package "/opam") - (lambda _ - (format #t "~a" test-opam-file)))) - (match (opam->guix-package "foo" #:repo 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)) - (string=? (bytevector->nix-base32-string - test-source-hash) - hash)) - (x - (pk 'fail x #f)))))) + (let ((my-package (string-append test-repo + "/packages/foo/foo.1.0.0"))) + (mkdir-p my-package) + (with-output-to-file (string-append my-package "/opam") + (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)) + (string=? (bytevector->nix-base32-string + test-source-hash) + hash)) + (x + (pk 'fail x #f))))) ;; Test the opam file parser ;; We fold over some test cases. Each case is a pair of the string to parse and the |