Closed perlpunk closed 9 months ago
This is because of a bad skip count. The fix is:
diff --git a/Email-Valid/t/valid.t b/Email-Valid/t/valid.t
index 966e1643fb..4283cb4a75 100644
--- a/Email-Valid/t/valid.t
+++ b/Email-Valid/t/valid.t
@@ -128,7 +128,7 @@ ok(
);
SKIP: {
- skip "your dns appears missing or failing to resolve", 3
+ skip "your dns appears missing or failing to resolve", 4
unless eval { $v->address(-address=> 'devnull@pobox.com', -mxcheck => 1) };
if (
thanks, we are patching this locally now in openSUSE
The skip count is wrong, but there's another problem: if the test system has wildcard DNS records enabled, then it may surprisingly resolve non-existing DNS names. So will-never-exist.pobox.com may become will-never-exist.pobox.com.opensuse.de or so (depending on the setup of the local system).
This can be reproduced like this on Linux and BSD systems:
$ LOCALDOMAIN=opensuse.de perl -e 'warn((gethostbyname("will-never-exist.pobox.com"))[0])'
will-never-exist.pobox.com.opensuse.de at -e line 1.
Workaround: use a trailing dot to the non-existing DNS name to avoid expansion. The following should work:
diff --git a/t/valid.t b/t/valid.t
index 966e164..df01d3d 100644
--- a/t/valid.t
+++ b/t/valid.t
@@ -132,7 +132,7 @@ SKIP: {
unless eval { $v->address(-address=> 'devnull@pobox.com', -mxcheck => 1) };
if (
- $v->address(-address => 'blort@will-never-exist.pobox.com', -mxcheck => 1)
+ $v->address(-address => 'blort@will-never-exist.pobox.com.', -mxcheck => 1)
) {
skip "your dns is lying to you; you must not use mxcheck", 3;
}
@@ -143,7 +143,7 @@ SKIP: {
);
ok(
- !$v->address(-address => 'blort@will-never-exist.pobox.com', -mxcheck => 1),
+ !$v->address(-address => 'blort@will-never-exist.pobox.com.', -mxcheck => 1),
'blort@will-never-exist.pobox.com, with mxcheck, is invalid',
) or diag "was using $Email::Valid::DNS_Method for dns resolution";
(see also https://github.com/tokuhirom/Furl/issues/128 )
Thanks, I've applied both locally and will make a release.
In openSUSE Tumbleweed: https://build.opensuse.org/package/live_build_log/devel:languages:perl:autoupdate/perl-Email-Valid/standard/x86_64