aboutsummaryrefslogtreecommitdiff
path: root/tests/lint.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-08-17 15:34:24 +0200
committerLudovic Courtès <ludo@gnu.org>2019-08-17 16:23:05 +0200
commit37592014e13abead7a691d0dcb5918d1a10f5cd6 (patch)
tree7f71fcd9b3ec1c225bff9a5f53131bab2f647c95 /tests/lint.scm
parent02460db0474ff5ac0d867ed6d5b192c062af0abc (diff)
downloadguix-37592014e13abead7a691d0dcb5918d1a10f5cd6.tar
guix-37592014e13abead7a691d0dcb5918d1a10f5cd6.tar.gz
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.
Diffstat (limited to 'tests/lint.scm')
-rw-r--r--tests/lint.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/lint.scm b/tests/lint.scm
index 8a9023a7a3..db6dd6dbe1 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -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"