Subject: | strptime for %F fails on Mac OS X - testing glibc extension format specifier |
Running the cpanp install of POSIX::strptime for Perl 5.16.1 on Mac OS X
10.7.5, I get the test failure:
Failed 1/1 subtests
# Failed test '2005-02-04 10:32:34 +0100|%F %T %z|34 32 10 4 1 105'
# at t/POSIX-strptime.t line 21.
# Structures begin differing at:
# $got->[2] = '1'
# $expected->[2] = '10'
# Looks like you failed 1 test of 6.
t/POSIX-strptime.t ..
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests
Looking at the POSIX specification of strptime
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html),
'%F' is not a POSIX standard format specifier.
Looking at the Linux man page for strptime
(http://linux.die.net/man/3/strptime), I see:
---------
Glibc Notes
For reasons of symmetry, glibc tries to support for strptime() the same
format characters as for strftime(3). (In most cases the corresponding
fields are parsed, but no field in tm is changed.) This leads to
%F
Equivalent to %Y-%m-%d, the ISO 8601 date format.
---------
There are also some other glibc-specific extensions to strptime listed
there.
I'm not sure how you'll want to fix this. It would obviously be simple
just to delete this test. Alternatively, you might decide to only run
it when you're using glibc, or only report it as a problem if you're
using glibc. That, though, raises the question of how you know you're
dealing with glibc.
I've installed the module; it'll do fine for me as it is. This is more
along the lines of a heads up.
--
Jonathan Leffler <jleffler@earthlink.net> <jleffler@us.ibm.com>
Guardian of DBD::Informix 2011.0612 -- see http://dbi.perl.org/
"I don't suffer from insanity - I enjoy every minute of it!"