Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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
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
#!/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.