Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WebService-Coinbase CPAN distribution.

Report information
The Basics
Id: 121328
Status: open
Priority: 0/
Queue: WebService-Coinbase

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

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



CC: MAUKE [...] cpan.org
Subject: Tests fail (with Function::Parameters 2.x?)
I see a new test failure: ... # Failed test 'WebService/Coinbase.pm loaded ok' # at t/00-compile.t line 37. # got: '512' # expected: '0' In method get_accounts: I was expecting a parameter list, not "{" at /tmpfs/.cpan-build-cpansand/2017042318/WebService-Coinbase-0.0200-0/blib/lib/WebService/Coinbase.pm line 39. Compilation failed in require at -e line 1. # Looks like you failed 1 test of 1. t/00-compile.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests ... This is probably caused by changes in Function::Parameters 2.x.
On Sun Apr 23 15:51:02 2017, SREZIC wrote: Show quoted text
> I see a new test failure: > > ... > # Failed test 'WebService/Coinbase.pm loaded ok' > # at t/00-compile.t line 37. > # got: '512' > # expected: '0' > In method get_accounts: I was expecting a parameter list, not "{" at > /tmpfs/.cpan-build-cpansand/2017042318/WebService-Coinbase-0.0200- > 0/blib/lib/WebService/Coinbase.pm line 39. > Compilation failed in require at -e line 1. > # Looks like you failed 1 test of 1. > t/00-compile.t .. > Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/1 subtests > ... > > This is probably caused by changes in Function::Parameters 2.x.
There are two problems: 1. Methods without parameter lists. It looks like they're meant to take no arguments, so adding "()" should work (and be compatible with F:P 1): # untested find lib -name '*.pm' -type f -exec perl -i -pe 's/\bmethod\s*\{/method () {/; s/\bmethod\s+(\w+)\s*\{/method $1() {/' '{}' ';' 2. Undefined types (HashRef, Maybe). This is a bit harder to solve because you have to decide how. There are a couple of ways: - Add 'use MooseX::Types::Moose qw(HashRef Maybe);' to those modules. This adds a new dependency (MooseX::Types) but should be compatible with F:P 1 and F:P 2. - Replace 'use Function::Parameters' by 'use Function::Parameters { method => { defaults => 'method', reify_type => 'moose' } }'. This keeps the old functionality but requires at least version 2 of F:P. (So maybe it should be 'use Function::Parameters 2 { method => { defaults => 'method', reify_type => 'moose' } }' to make it explicit.) - Replace 'use Function::Parameters' by 'use Function::Parameters { method => { defaults => 'method', reify_type => sub { require Moose::Util::TypeConstraints; Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($_[0]) } } };'. This should be compatible with F:P back to version 1.4 or thereabouts, but looks really ugly.