Installation of Date::ICal fails when running the sanity tests

Viewed 36

I am trying to install the module Date::ICal and it is failing one of the tests. The output is:

Running make test for RBOW/Date-ICal-2.678.tar.gz
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00load.t ........ ok   
t/01sanity.t ...... 1/? 
#   Failed test 'Epoch time of 0'
#   at t/01sanity.t line 13.
#          got: '3155760000'
#     expected: '0'

#   Failed test 'Time should be stored in UTC anyway, right?'
#   at t/01sanity.t line 28.
#          got: '3155760000'
#     expected: '0'
# Looks like you failed 2 tests of 22.
t/01sanity.t ...... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/22 subtests 
t/02normalize.t ... ok   
t/03components.t .. ok   
t/04epoch.t ....... 1/? 
#   Failed test 'creation test from epoch (compare to epoch)'
#   at t/04epoch.t line 8.
#          got: '3155760000'
#     expected: '0'

#   Failed test 'creation test from epoch = 3600 (compare to epoch)'
#   at t/04epoch.t line 19.
#          got: '3155763600'
#     expected: '3600'
# Looks like you failed 2 tests of 18.
t/04epoch.t ....... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/18 subtests 
Failed 2/18 subtests 
t/05ical.t ........ ok    
t/06add.t ......... ok     
t/07compare.t ..... ok    
t/08offset.t ...... 1/? 
#   Failed test 'creation test from epoch (compare to epoch)'
#   at t/08offset.t line 8.
# Looks like you failed 1 test of 30.
t/08offset.t ...... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/30 subtests 
t/09greg.t ........ ok    
t/10subtract.t .... ok    
t/11duration.t .... ok   

I have tried this on a Raspberry Pi3 and also in the Ubuntu app on Windows 11, with the same results on both.

It looks like they are both adding an offset of 3155760000 to the epoch. Any ideas why and how to fix it?

1 Answers

It looks like something is off by a year (3155760000 seconds in a year, roughly π*10^9). The module hasn't been updated in a year, and the warning in the module says not to use it:

Please note that this module is long-since abandoned. While I do accept patches, and occasionally apply them, for the most part it is recommended that you move off of this module and use the various modules developed by the datetime project. You can find out more about the datetime project at http://datetime.perl.org/

If you are installing this for some legacy thing, does the current version of the module match what you were using before?

Related