summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-10-17 23:12:07 +0200
committerLudovic Courtès <ludo@gnu.org>2022-10-17 23:15:08 +0200
commit2383e145185efb2e6f99931707ec93d65d166432 (patch)
tree5c7da83f4b3678761641a7c2baed35fa199154cc /tests
parentec73570be5112a4e4f224b86e06529d1987f2088 (diff)
downloadguix-2383e145185efb2e6f99931707ec93d65d166432.tar.gz
lint: source: Add check for <svn-reference> over HTTP(S).
* guix/lint.scm (svn-reference-uri-with-userinfo): New procedure.
(check-source): Add 'svn-reference?' clause.
* tests/lint.scm ("source: svn-reference, HTTP 200")
("source: svn-reference, HTTP 404"): New tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/lint.scm32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 8be74d2604..b848e32aee 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -35,6 +35,7 @@
   #:use-module (guix tests http)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix svn-download)
   #:use-module (guix build-system texlive)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
@@ -1085,6 +1086,35 @@
                 (and (? lint-warning?) second-warning))
                (lint-warning-message second-warning)))))))))
 
+(test-equal "source: svn-reference, HTTP 200"
+  '()
+  (with-http-server `((200 ,%long-string))
+    (let ((pkg (package
+                 (inherit (dummy-package "x"))
+                 (source (origin
+                           (method svn-fetch)
+                           (uri (svn-reference
+                                 (url (%local-url))
+                                 (revision 1234)))
+                           (sha256 %null-sha256))))))
+      (check-source pkg))))
+
+(with-http-server `((404 ,%long-string))
+  (test-equal "source: svn-reference, HTTP 404"
+    (format #f "URI ~a not reachable: 404 (\"Such is life\")"
+            (%local-url))
+    (let ((pkg (package
+                 (inherit (dummy-package "x"))
+                 (source (origin
+                           (method svn-fetch)
+                           (uri (svn-reference
+                                 (url (%local-url))
+                                 (revision 1234)))
+                           (sha256 %null-sha256))))))
+      (match (check-source pkg)
+        ((warning)
+         (lint-warning-message warning))))))
+
 (test-equal "mirror-url"
   '()
   (let ((source (origin