Skip Menu |

This queue is for tickets about the Perl6-Junction CPAN distribution.

Report information
The Basics
Id: 24237
Status: resolved
Priority: 0/
Queue: Perl6-Junction

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

Bug Information
Severity: Important
Broken in: 1.10
Fixed in: (no value)



Subject: Junctions don't play well with Test::Builder
The following test script illustrates the problem (version 1.10): use Test::More tests => 4; use Perl6::Junction 'any'; my $ab = any(qw<a b>); ok 'a' eq $ab, 'direct compare match'; is 'a', $ab, 'test passed'; TODO: { local $TODO = 'just playing around'; ok 'c' eq $ab, 'direct compare match'; is 'c', $ab, 'test passed'; } This results in the following output: 1..4 ok 1 - direct compare match ok 2 - test passed not ok 3 - direct compare match # TODO just playing around # Failed (TODO) test 'direct compare match' # in test.pl at line 10. not ok 4 - test passed # TODO just playing around # Failed (TODO) test 'test passed' # in test.pl at line 11. Operation `""': no method found, argument in overloaded package Perl6::Junction::Any at /usr/local/lib/perl5/5.8.7/Test/Builder.pm line 580. # Looks like your test died just after 4. Cheers, Ovid
This is because there was no string overloading, and no fallback. I've added string overloading (the reference machine-address is returned), which stops this fatal error, even though it isn't otherwise very helpful. I've also implemented bool overloading, as otherwise bool context would use the string overloading by default, incorrectly causing it to always return true. This is implemented in dev version 1.20_01 - feedback on the suitability of the fix would be appreciated, so I can push it to a stable release.