print.scm 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (test-print)
  19. #:use-module (guix import print)
  20. #:use-module (guix build-system gnu)
  21. #:use-module (guix download)
  22. #:use-module (guix packages)
  23. #:use-module (guix licenses)
  24. #:use-module (srfi srfi-64))
  25. (test-begin "print")
  26. (define pkg
  27. (package
  28. (name "test")
  29. (version "1.2.3")
  30. (source (origin
  31. (method url-fetch)
  32. (uri (string-append "file:///tmp/test-"
  33. version ".tar.gz"))
  34. (sha256
  35. (base32
  36. "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
  37. (build-system gnu-build-system)
  38. (home-page "http://gnu.org")
  39. (synopsis "Dummy")
  40. (description "This is a dummy package.")
  41. (license gpl3+)))
  42. (test-equal "simple package"
  43. (package->code pkg)
  44. '(package
  45. (name "test")
  46. (version "1.2.3")
  47. (source (origin
  48. (method url-fetch)
  49. (uri (string-append "file:///tmp/test-"
  50. version ".tar.gz"))
  51. (sha256
  52. (base32
  53. "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
  54. (build-system gnu-build-system)
  55. (home-page "http://gnu.org")
  56. (synopsis "Dummy")
  57. (description "This is a dummy package.")
  58. (license gpl3+)))
  59. (test-end "print")