summaryrefslogtreecommitdiff
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)
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 8be74d2604d..b848e32aee1 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -1,7 +1,7 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com> 2;;; Copyright © 2012, 2013 Cyril Roelandt <tipecaml@gmail.com>
3;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org> 3;;; Copyright © 2014, 2015, 2016 Eric Bavier <bavier@member.fsf.org>
4;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> 4;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org>
5;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org> 5;;; Copyright © 2015, 2016 Mathieu Lirzin <mthl@gnu.org>
6;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com> 6;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
7;;; Copyright © 2017 Alex Kost <alezost@gmail.com> 7;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
@@ -35,6 +35,7 @@
35 #:use-module (guix tests http) 35 #:use-module (guix tests http)
36 #:use-module (guix download) 36 #:use-module (guix download)
37 #:use-module (guix git-download) 37 #:use-module (guix git-download)
38 #:use-module (guix svn-download)
38 #:use-module (guix build-system texlive) 39 #:use-module (guix build-system texlive)
39 #:use-module (guix build-system emacs) 40 #:use-module (guix build-system emacs)
40 #:use-module (guix build-system gnu) 41 #:use-module (guix build-system gnu)
@@ -1085,6 +1086,35 @@
1085 (and (? lint-warning?) second-warning)) 1086 (and (? lint-warning?) second-warning))
1086 (lint-warning-message second-warning))))))))) 1087 (lint-warning-message second-warning)))))))))
1087 1088
1089(test-equal "source: svn-reference, HTTP 200"
1090 '()
1091 (with-http-server `((200 ,%long-string))
1092 (let ((pkg (package
1093 (inherit (dummy-package "x"))
1094 (source (origin
1095 (method svn-fetch)
1096 (uri (svn-reference
1097 (url (%local-url))
1098 (revision 1234)))
1099 (sha256 %null-sha256))))))
1100 (check-source pkg))))
1101
1102(with-http-server `((404 ,%long-string))
1103 (test-equal "source: svn-reference, HTTP 404"
1104 (format #f "URI ~a not reachable: 404 (\"Such is life\")"
1105 (%local-url))
1106 (let ((pkg (package
1107 (inherit (dummy-package "x"))
1108 (source (origin
1109 (method svn-fetch)
1110 (uri (svn-reference
1111 (url (%local-url))
1112 (revision 1234)))
1113 (sha256 %null-sha256))))))
1114 (match (check-source pkg)
1115 ((warning)
1116 (lint-warning-message warning))))))
1117
1088(test-equal "mirror-url" 1118(test-equal "mirror-url"
1089 '() 1119 '()
1090 (let ((source (origin 1120 (let ((source (origin