Search code examples
perlcpandancer

Failed tests building Dancer2::Plugin::Auth::OAuth from CPAN


I'm trying to build the Dancer2::Plugin::Auth::OAuth module from CPAN. The test fails with:

Running Build test
t/01-dancer.t .......... 1/? 
#   Failed test '[github] Session data'
#   at t/01-dancer.t line 238.
#     Structures begin differing at:
#          $got->{user_info}{site_admin} = 'false'
#     $expected->{user_info}{site_admin} = '0'

#   Failed test '[stackexchange] Session data'
#   at t/01-dancer.t line 238.
#     Structures begin differing at:
#          $got->{user_info}{has_more} = 'false'
#     $expected->{user_info}{has_more} = '0'
# Looks like you failed 2 tests of 55.

But the CPAN testers reports are all green for Linux so it's probably something wrong on my system.

What should I look at?

OS: CentOS 7.3
Perl: 5.16.3 (distro package)


Solution

  • That looks to me like a bugged test

    Perl uses 0, "0", "" and undef as false, and everything else is true

    This output

    #          $got->{user_info}{site_admin} = 'false'
    #     $expected->{user_info}{site_admin} = '0'
    

    says that the hash element was set to the string false when the test expected a zero

    Since this is only two out of 55 tests that is giving a problem, I would force the installation using

    cpan -f Dancer2::Plugin::Auth::OAuth