mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
lint: Add test for 'source'.
* tests/lint.scm ("source: 404 and 200"): New test.
This commit is contained in:
parent
848ae71ea7
commit
99b2042812
1 changed files with 17 additions and 0 deletions
|
@ -618,6 +618,23 @@ (define single-lint-warning-message
|
|||
(and (? lint-warning?) second-warning))
|
||||
(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"
|
||||
|
|
Loading…
Reference in a new issue