tests: Relax expectations for the 'home-page' checker.
Fixes a regression introduced in 50fc2384feb3bb2677d074f8f0deb5ae3c56b4d8. * 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 commit 50fc2384feb. 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
@ -74,6 +74,12 @@
|
||||
(((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 @@
|
||||
(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 New Issue
Block a user