summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorXinglu Chen <public@yoctocell.xyz>2021-12-17 21:55:54 +0100
committerLudovic Courtès <ludo@gnu.org>2021-12-18 22:51:55 +0100
commitf21c70bc9a41d000acf7d39a0813a3c7415517ca (patch)
tree702facf91a33789ab228914437f37dce1701c7ab /tests
parent08b0f5c2a55fb06df8b5594ccbddaf3b01f9f8d4 (diff)
downloadguix-f21c70bc9a41d000acf7d39a0813a3c7415517ca.tar.gz
import: elpa: Support ‘upstream-name’ property.
* guix/import/elpa.scm: (guix-package->elpa-name): New procedure.
  (latest-release): Use it.
* tests/elpa.scm ("guix-package->elpa-name: without 'upstream-name' property")
  ("guix-package->elpa-name: with 'upstream-name' property"): Test it.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/elpa.scm12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/elpa.scm b/tests/elpa.scm
index 01ef948b2e..1efdf2457f 100644
--- a/tests/elpa.scm
+++ b/tests/elpa.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 
 (define-module (test-elpa)
   #:use-module (guix import elpa)
+  #:use-module (guix tests)
   #:use-module (guix tests http)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-64)
@@ -71,6 +73,16 @@
 (test-assert "elpa->guix-package test 1"
   (eval-test-with-elpa "auctex"))
 
+(test-equal "guix-package->elpa-name: without 'upstream-name' property"
+  "auctex"
+  (guix-package->elpa-name (dummy-package "emacs-auctex")))
+
+(test-equal "guix-package->elpa-name: with 'upstream-name' property"
+  "project"
+  (guix-package->elpa-name
+   (dummy-package "emacs-fake-name"
+     (properties '((upstream-name . "project"))))))
+
 (test-end "elpa")
 
 ;; Local Variables: