Skip Menu |
 

This queue is for tickets about the Path-Router CPAN distribution.

Report information
The Basics
Id: 78388
Status: resolved
Priority: 0/
Queue: Path-Router

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

Bug Information
Severity: Normal
Broken in: 0.11
Fixed in: (no value)



Subject: Path component values getting erroneously dropped
Download (untitled) / with headers
text/plain 218b
The mapping for a placeholder path component gets discarded if the component's value evaluates to false, as in the example cases given in the test file. I tried to sort it out but got lost amid the source generation.
Subject: router-fail.pl
Download router-fail.pl
text/x-perl 430b
#!/usr/bin/env perl use strict; use warnings; use Test::More; use Path::Router; my $router = Path::Router->new; $router->add_route( '/asdf/:foo/:bar' ); my @paths = ( ['/asdf/123/456', '123', '456'], ['/asdf/0/456', '0', '456'], ['/asdf/123/0', '123', '0'], ); for (@paths) { my $match = $router->match($_->[0]); is $match->mapping->{foo}, $_->[1]; is $match->mapping->{bar}, $_->[2]; } done_testing;
Fixed in 0.12.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.