summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-10-29 21:51:39 +0200
committerLudovic Courtès <ludo@gnu.org>2021-11-11 00:14:31 +0100
commit04d929570ad816793d7e0024a11314124ce87f98 (patch)
tree735825ce00192b1dd14376dd43d98a1e06664c79 /tests
parent450e1dd52e0a34bb00fcb655956e40d69d50a331 (diff)
downloadguix-04d929570ad816793d7e0024a11314124ce87f98.tar.gz
import: print: Properly render packages with origins as inputs.
* guix/import/print.scm (package->code)[source->code]: Check whether
VERSION is true before calling 'factorize-uri'.
[package-lists->code]: Add clause for inputs that are origins.
* tests/print.scm (pkg-with-origin-input, pkg-with-origin-input-source):
New variables.
("package with origin input"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/print.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/print.scm b/tests/print.scm
index 3386590d3a..ad19f4573a 100644
--- a/tests/print.scm
+++ b/tests/print.scm
@@ -67,6 +67,30 @@
     (description "This is a dummy package.")
     (license license:gpl3+)))
 
+(define-with-source pkg-with-origin-input pkg-with-origin-input-source
+  (package
+    (name "test")
+    (version "1.2.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "file:///tmp/test-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "070pwb7brdcn1mfvplkd56vjc7lbz4iznzkqvfsakvgbv68k71ah"))))
+    (build-system (@ (guix build-system gnu) gnu-build-system))
+    (inputs
+     `(("o" ,(origin
+               (method url-fetch)
+               (uri "http://example.org/somefile.txt")
+               (sha256
+                (base32
+                 "0000000000000000000000000000000000000000000000000000"))))))
+    (home-page "http://gnu.org")
+    (synopsis "Dummy")
+    (description "This is a dummy package.")
+    (license license:gpl3+)))
+
 (test-equal "simple package"
   `(define-public test ,pkg-source)
   (package->code pkg))
@@ -75,4 +99,8 @@
   `(define-public test ,pkg-with-inputs-source)
   (package->code pkg-with-inputs))
 
+(test-equal "package with origin input"
+  `(define-public test ,pkg-with-origin-input-source)
+  (package->code pkg-with-origin-input))
+
 (test-end "print")