my $dp = Web::Dispatch::Parser->new;
{
+ my $all = $dp->parse('');
+
+ is_deeply(
+ [ $all->({ REQUEST_METHOD => 'GET' }) ],
+ [ {} ],
+ 'GET matches'
+ );
+
+ is_deeply(
+ [ $all->({ REQUEST_METHOD => 'POST' }) ],
+ [ {} ],
+ 'POST matches'
+ );
+};
+
+{
my $get = $dp->parse('GET');
is_deeply(
);
}
+{
+ my @dot_pairs = (
+ [ '/one/*' => 'two' ],
+ [ '/one/*.*' => 'two.three' ],
+ [ '/**' => 'one/two' ],
+ [ '/**.*' => 'one/two.three' ],
+ );
+
+ foreach my $p (@dot_pairs) {
+ is_deeply(
+ [ $dp->parse($p->[0])->({ PATH_INFO => '/one/two.three' }) ],
+ [ {}, $p->[1] ],
+ "${\$p->[0]} matches /one/two.three and returns ${\$p->[1]}"
+ );
+ }
+}
+
#
# query string
#