upstream.scm 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016, 2023 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (test-upstream)
  20. #:use-module (gnu packages base)
  21. #:use-module (guix download)
  22. #:use-module (guix packages)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (guix import print)
  25. #:use-module ((guix licenses) #:prefix license:)
  26. #:use-module (guix upstream)
  27. #:use-module (guix tests)
  28. #:use-module (srfi srfi-64)
  29. #:use-module (ice-9 match))
  30. (test-begin "upstream")
  31. (test-equal "coalesce-sources same version"
  32. '((source "foo" "1"
  33. ("ftp://example.org/foo-1.tar.xz"
  34. "ftp://example.org/foo-1.tar.gz")
  35. ("ftp://example.org/foo-1.tar.xz.sig"
  36. "ftp://example.org/foo-1.tar.gz.sig")))
  37. (map (lambda (source)
  38. `(source ,(upstream-source-package source)
  39. ,(upstream-source-version source)
  40. ,(upstream-source-urls source)
  41. ,(upstream-source-signature-urls source)))
  42. (coalesce-sources (list (upstream-source
  43. (package "foo") (version "1")
  44. (urls '("ftp://example.org/foo-1.tar.gz"))
  45. (signature-urls
  46. '("ftp://example.org/foo-1.tar.gz.sig")))
  47. (upstream-source
  48. (package "foo") (version "1")
  49. (urls '("ftp://example.org/foo-1.tar.xz"))
  50. (signature-urls
  51. '("ftp://example.org/foo-1.tar.xz.sig")))))))
  52. (test-end)