CGI-PathParam
view release on metacpan or search on metacpan
t/CGI-PathParam.t view on Meta::CPAN
is_deeply( [ $cgi->path_param ], [], 'no argument(path_info is / only)' );
$cgi->path_info('/foo');
is_deeply( [ $cgi->path_param ], ['foo'], 'one argument' );
$cgi->path_info('/foo/bar');
is_deeply( [ $cgi->path_param ], [ 'foo', 'bar' ], 'some arguments' );
$cgi->path_info('/foo%2Fbar');
is_deeply( [ $cgi->path_param ],
['foo/bar'], 'contains %2F(slash which is percent encoded)' );
$cgi->path_info('/foo%2Fbar%2Fbaz');
is_deeply( [ $cgi->path_param ], ['foo/bar/baz'], 'contains some %2F' );
$cgi->path_info('/foo/bar%2Fbaz');
is_deeply( [ $cgi->path_param ], [ 'foo', 'bar/baz' ], 'mix of / and %2F' );
# setter tests
$cgi->path_param(undef); # This causes warnings 'uninitialized'.
is( $cgi->path_info, q{}, 'set an undef' );
( run in 0.326 second using v1.01-cache-2.11-cpan-709fd43a63f )