Skip Menu |

This queue is for tickets about the Data-Sah CPAN distribution.

Report information
The Basics
Id: 125478
Status: resolved
Priority: 0/
Queue: Data-Sah

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.891
Fixed in: (no value)



Subject: Test failure on freebsd >= 11
On my freebsd 11 and 12 smokers (but not on version 9 and 10) the test suite fails: ... # Failed test 'data "2014-01-02" should not pass schema ["date", "min", "2014-01-02T02:10:10Z"]' # at /home/cpansand/.cpan/build/2018060415/Data-Sah-0.891-0/blib/lib/Test/Data/Sah.pm line 56. # schema compilation result: # ----begin generated code---- # # skip if undef # (!defined($data) ? 1 : # # (# coerce rule(s): obj_DateTime, float_epoch, obj_TimeMoment, str_iso8601 # coerce to: float(epoch) # (($data = (Scalar::Util::blessed($data) && $data->isa('DateTime')) ? [undef,$data->epoch] : ((!ref($data) && $data =~ /\A[0-9]{8,10}(?:.[0-9]+)?\z/ && $data >= 10**8 && $data <= 2**31) ? [undef,$data] : ((Scalar::Util::blessed($data) && $data->isa('Time::Moment')) ? [undef,$data->epoch] : ((!ref($data) && $data =~ /\A([0-9]{4})-([0-9]{2})-([0-9]{2})(?:([T ])([0-9]{2}):([0-9]{2}):([0-9]{2})(Z?))?\z/) ? (do { my $time; eval { $time = $4 ? ($8 ? Time::Local::timegm($7, $6, $5, $3, $2-1, $1-1900) : Time::Local::timelocal($7, $6, $5, $3, $2-1, $1-1900)) : Time::Local::timelocal(0, 0, 0, $3, $2-1, $1-1900) }; my $err = $@; if ($err) { $err =~ s/ at .+//s; ["Invalid date/time: $err"] } else { [undef, $time] } }) : [undef,$data])))), defined($data->[0]) ? '' : (($data = $data->[1]), 1)) # # && # # # check type 'date' # (!ref($data) && $data =~ /\A[0-9]+\z/) # # && # # (# clause: min # ($data >= 1388628610)))) # ----end generated code---- # that code should return false when fed $data="2014-01-02" but instead returns 1 # # validator result (full): # ----begin result---- # { # 'value' => 1388649600 # } # ----end result---- # Looks like you failed 1 test of 15. t/perl-type-date.t ....... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/15 subtests ... The further test log seems to be very long and truncated by Test::Reporter (maximum of 1MB test log data). The huge log is caused by warnings like this: ... Only coercion rule module 'Data::Sah::Coerce::perl::float::str_share' following metadata version 3 is supported, this rule module follows metadata version 2 and will not be used at /home/cpansand/.cpan/build/2018060415/Data-Sah-Coerce-0.025-0/blib/lib/Data/Sah/CoerceCommon.pm line 229. Only coercion rule module 'Data::Sah::Coerce::perl::float::str_as_percent' following metadata version 3 is supported, this rule module follows metadata version 2 and will not be used at /home/cpansand/.cpan/build/2018060415/Data-Sah-Coerce-0.025-0/blib/lib/Data/Sah/CoerceCommon.pm line 229. ...
I think this problem is caused by timezone. The failing test is: comparing that "2014-01-02" is less than "2014-01-02T02:10:10Z" but the former uses local time zone (timelocal() function) while the latter uses timegm(), so the test might succeed or fail depending on the local timezone. I will have to fix the test case.
On Tue, 5 Jun 2018 04:55:47 GMT, PERLANCAR wrote: Show quoted text
> I think this problem is caused by timezone. The failing test is: > comparing that "2014-01-02" is less than "2014-01-02T02:10:10Z" but > the former uses local time zone (timelocal() function) while the > latter uses timegm(), so the test might succeed or fail depending on > the local timezone. I will have to fix the test case.
Fixed in 0.892.r