summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-07-20 01:18:11 +0200
committerLudovic Courtès <ludo@gnu.org>2019-07-20 01:32:17 +0200
commit99b204281235a2b6a44d949e08bc517188b21e49 (patch)
tree00b51492cec98ed64fce329c55cb53023068fcbf /tests
parent848ae71ea7131e78a7b728863eac1056c33b2679 (diff)
downloadguix-99b204281235a2b6a44d949e08bc517188b21e49.tar.gz
lint: Add test for 'source'.
* tests/lint.scm ("source: 404 and 200"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/lint.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 5127a84c72..8a9023a7a3 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -619,6 +619,23 @@
          (lint-warning-message second-warning))))))
 
 (test-skip (if (http-server-can-listen?) 0 1))
+(test-equal "source: 404 and 200"
+  '()
+  (with-http-server 404 %long-string
+    (let ((bad-url (%local-url)))
+      (parameterize ((%http-server-port (+ 1 (%http-server-port))))
+        (with-http-server 200 %long-string
+          (let ((pkg (package
+                       (inherit (dummy-package "x"))
+                       (source (origin
+                                 (method url-fetch)
+                                 (uri (list bad-url (%local-url)))
+                                 (sha256 %null-sha256))))))
+            ;; Since one of the two URLs is good, this should return the empty
+            ;; list.
+            (check-source pkg)))))))
+
+(test-skip (if (http-server-can-listen?) 0 1))
 (test-equal "source: 301 -> 200"
   "permanent redirect from http://localhost:10000/foo/bar to http://localhost:9999/foo/bar"
   (with-http-server 200 %long-string