mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
tests: Relax expectations for the 'home-page' checker.
Fixes a regression introduced in50fc2384fe
. * tests/lint.scm (warning-contains?): New procedure. ("home-page: host not found"): Use 'warning-contains?' instead of testing for equality, as was the case before commit50fc2384fe
. This handles the case where the 'getaddrinfo' error is not "Name or service not known" but instead something like "System error" or "Servname not supported for ai_socktype", as is the case in the build environment.
This commit is contained in:
parent
02460db047
commit
37592014e1
1 changed files with 8 additions and 4 deletions
|
@ -74,6 +74,12 @@ (define single-lint-warning-message
|
|||
(((and (? lint-warning?) warning))
|
||||
(lint-warning-message warning))))
|
||||
|
||||
(define (warning-contains? str warnings)
|
||||
"Return true if WARNINGS is a singleton with a warning that contains STR."
|
||||
(match warnings
|
||||
(((? lint-warning? warning))
|
||||
(string-contains (lint-warning-message warning) str))))
|
||||
|
||||
|
||||
(test-begin "lint")
|
||||
|
||||
|
@ -366,13 +372,11 @@ (define single-lint-warning-message
|
|||
(single-lint-warning-message
|
||||
(check-home-page pkg))))
|
||||
|
||||
(test-equal "home-page: host not found"
|
||||
"URI http://does-not-exist domain not found: Name or service not known"
|
||||
(test-assert "home-page: host not found"
|
||||
(let ((pkg (package
|
||||
(inherit (dummy-package "x"))
|
||||
(home-page "http://does-not-exist"))))
|
||||
(single-lint-warning-message
|
||||
(check-home-page pkg))))
|
||||
(warning-contains? "domain not found" (check-home-page pkg))))
|
||||
|
||||
(test-skip (if (http-server-can-listen?) 0 1))
|
||||
(test-equal "home-page: Connection refused"
|
||||
|
|
Loading…
Reference in a new issue