coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 minor test fails on FreeBSD-10 with 8.22.157-1b243


From: Assaf Gordon
Subject: Re: 2 minor test fails on FreeBSD-10 with 8.22.157-1b243
Date: Fri, 18 Jul 2014 19:18:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/18/2014 06:10 PM, Pádraig Brady wrote:
On 07/18/2014 11:06 PM, Assaf Gordon wrote:
On 07/18/2014 05:43 PM, Pádraig Brady wrote:
On 07/18/2014 10:19 PM, Assaf Gordon wrote:

     $ perl -w -e '@d=localtime(2**56);'
     Name "main::d" used only once: possible typo at -e line 1.
     localtime(72057594037927936) too large at -e line 1.
     localtime(72057594037927936) failed at -e line 1.

That's not the problem. We want a value that's known to fail.

Then the subsequent uninit-64 uses that value passed to `date`
and we want that to fail too. Unfortunately it seems to be passing.
Hence my comment about the mismatch between perl and what date is doing.

Ah, I understand now - The perl warning is expected, just normally not shown 
because the test itself succeeds (as in, date fails and returns exit code 1).

So, testing directly on this system, with the value passed in the test:

    $ perl -w -e '@d=localtime(72057594037927935)'
    Name "main::d" used only once: possible typo at -e line 1.
    localtime(72057594037927936) too large at -e line 1.
    localtime(72057594037927936) failed at -e line 1.

    $ ./src/date -d @72057594037927935
    Tue Apr 14 22:37:44 UTC 2015

    $ ./src/date --version
    date (GNU coreutils) 8.22.157-1b243-dirty

A problem in 'date' as it's compiled on this system?


====
More Perl-vs-Date comparisons on this system:
====
$ for i in $(seq 50 64) ; do
  echo "Testing 2^$i-1" ; \
  perl -e "\$val=2**$i-1;" \
     -e '@d=localtime($val);' \
     -e '@d and printf "  Perl = %d/%d/%d\n",$d[3],$d[4]+1,$d[5]+1900;'\
     -e '@d or print "  Perl = invalid date\n";' ; \
  ./src/date -d @$(echo 2^${i}-1|bc) +"  Date = %d/%m/%Y" ; \
done

Testing 2^50-1
  Perl = 25/9/35680317
  Date = 25/09/35680317
Testing 2^51-1
  Perl = 19/6/71358665
  Date = 19/06/71358665
Testing 2^52-1
  Perl = 6/12/142715360
  Date = 06/12/142715360
Testing 2^53-1
  Perl = 12/11/285428751
  Date = 12/11/285428751
Testing 2^54-1
  Perl = 22/9/570855533
  Date = 22/09/570855533
Testing 2^55-1
  Perl = 13/6/1141709097
  Date = 13/06/1141709097
Testing 2^56-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^57-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^58-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^59-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^60-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^61-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^62-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^63-1
  Perl = invalid date
  Date = 14/04/2015
Testing 2^64-1
  Perl = invalid date
./src/date: invalid date '@18446744073709551615'

=====





reply via email to

[Prev in Thread] Current Thread [Next in Thread]