summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-05-18 16:33:37 +0200
committerLudovic Courtès <ludo@gnu.org>2023-05-31 23:25:26 +0200
commitd46d1bee1ea93d8fba97d7f8cadd142c493dc3bf (patch)
tree154c0a0fc30b31ca7662183781925b0ae8fee330 /tests
parenta738c1a0c75af8b65ab5cad893e9ac2af6633d29 (diff)
downloadguix-d46d1bee1ea93d8fba97d7f8cadd142c493dc3bf.tar.gz
import: elpa: Updater provides input list.
* guix/import/elpa.scm (elpa-dependency->upstream-input): New
procedure.
(latest-release): Add 'inputs' field.
* tests/elpa.scm ("package-latest-release"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/elpa.scm48
1 files changed, 46 insertions, 2 deletions
diff --git a/tests/elpa.scm b/tests/elpa.scm
index 1efdf2457f..56008fe014 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
-;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020, 2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
@@ -21,6 +21,8 @@
 
 (define-module (test-elpa)
   #:use-module (guix import elpa)
+  #:use-module (guix upstream)
+  #:use-module ((guix download) #:select (url-fetch))
   #:use-module (guix tests)
   #:use-module (guix tests http)
   #:use-module (srfi srfi-1)
@@ -40,8 +42,20 @@
     (auctex .
             [(11 88 6)
              nil "Integrated environment for *TeX*" tar
-             ((:url . "http://www.gnu.org/software/auctex/"))])))
+             ((:url . "http://www.gnu.org/software/auctex/"))])
+    (taxy-magit-section .
+		        [(0 12 2)
+		         ((emacs
+			   (26 3))
+		          (magit-section
+			   (3 2 1))
+		          (taxy
+			   (0 10)))
+		         "View Taxy structs in a Magit Section buffer" tar
+		         ((:url . "https://github.com/alphapapa/taxy.el")
+		          (:keywords "lisp"))])))
 
+
 (test-begin "elpa")
 
 (define (eval-test-with-elpa pkg)
@@ -73,6 +87,36 @@
 (test-assert "elpa->guix-package test 1"
   (eval-test-with-elpa "auctex"))
 
+(test-equal "package-latest-release"
+  (list '("https://elpa.gnu.org/packages/taxy-magit-section-0.12.2.tar")
+        '("https://elpa.gnu.org/packages/taxy-magit-section-0.12.2.tar.sig")
+        (list (upstream-input
+               (name "magit-section")
+               (downstream-name "emacs-magit-section")
+               (type 'propagated)
+               (min-version "3.2.1")
+               (max-version min-version))
+              (upstream-input
+               (name "taxy")
+               (downstream-name "emacs-taxy")
+               (type 'propagated)
+               (min-version "0.10")
+               (max-version #f))))
+  (with-http-server `((200 ,(object->string elpa-mock-archive)))
+    (parameterize ((current-http-proxy (%local-url)))
+      (define source
+        (package-latest-release
+         (dummy-package "emacs-taxy-magit-section"
+                        (version "0.0.0")
+                        (source (dummy-origin
+                                 (method url-fetch)
+                                 (uri "https://elpa.gnu.org/xyz"))))
+         (list %elpa-updater)))
+
+      (list (upstream-source-urls source)
+            (upstream-source-signature-urls source)
+            (upstream-source-inputs source)))))
+
 (test-equal "guix-package->elpa-name: without 'upstream-name' property"
   "auctex"
   (guix-package->elpa-name (dummy-package "emacs-auctex")))