.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Test::Path::Router 3pm" .TH Test::Path::Router 3pm "2021-01-08" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Path::Router \- A testing module for testing routes .SH "VERSION" .IX Header "VERSION" version 0.15 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Test::More plan => 1; \& use Test::Path::Router; \& \& my $router = Path::Router\->new; \& \& # ... define some routes \& \& path_ok($router, \*(Aqadmin/remove_user/56\*(Aq, \*(Aq... this is a valid path\*(Aq); \& \& path_is($router, \& \*(Aqadmin/edit_user/5\*(Aq, \& { \& controller => \*(Aqadmin\*(Aq, \& action => \*(Aqedit_user\*(Aq, \& id => 5, \& }, \& \*(Aq... the path and mapping match\*(Aq); \& \& mapping_ok($router, { \& controller => \*(Aqadmin\*(Aq, \& action => \*(Aqedit_user\*(Aq, \& id => 5, \& }, \*(Aq... this maps to a valid path\*(Aq); \& \& mapping_is($router, \& { \& controller => \*(Aqadmin\*(Aq, \& action => \*(Aqedit_user\*(Aq, \& id => 5, \& }, \& \*(Aqadmin/edit_user/5\*(Aq, \& \*(Aq... the mapping and path match\*(Aq); \& \& routes_ok($router, { \& \*(Aqadmin\*(Aq => { \& controller => \*(Aqadmin\*(Aq, \& action => \*(Aqindex\*(Aq, \& }, \& \*(Aqadmin/add_user\*(Aq => { \& controller => \*(Aqadmin\*(Aq, \& action => \*(Aqadd_user\*(Aq, \& }, \& \*(Aqadmin/edit_user/5\*(Aq => { \& controller => \*(Aqadmin\*(Aq, \& action => \*(Aqedit_user\*(Aq, \& id => 5, \& } \& }, \& "... our routes are valid"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module helps in testing out your path routes, to make sure they are valid. .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" .IP "\fBpath_ok ($router, \f(CB$path\fB, ?$message)\fR" 4 .IX Item "path_ok ($router, $path, ?$message)" .PD 0 .IP "\fBpath_not_ok ($router, \f(CB$path\fB, ?$message)\fR" 4 .IX Item "path_not_ok ($router, $path, ?$message)" .IP "\fBpath_is ($router, \f(CB$path\fB, \f(CB$mapping\fB, ?$message)\fR" 4 .IX Item "path_is ($router, $path, $mapping, ?$message)" .IP "\fBmapping_ok ($router, \f(CB$mapping\fB, ?$message)\fR" 4 .IX Item "mapping_ok ($router, $mapping, ?$message)" .IP "\fBmapping_not_ok ($router, \f(CB$mapping\fB, ?$message)\fR" 4 .IX Item "mapping_not_ok ($router, $mapping, ?$message)" .IP "\fBmapping_is ($router, \f(CB$mapping\fB, \f(CB$path\fB, ?$message)\fR" 4 .IX Item "mapping_is ($router, $mapping, $path, ?$message)" .IP "\fBroutes_ok ($router, \e%test_routes, ?$message)\fR" 4 .IX Item "routes_ok ($router, %test_routes, ?$message)" .PD This test function will accept a set of \f(CW%test_routes\fR which will get checked against your \f(CW$router\fR instance. This will check to be sure that all paths in \f(CW%test_routes\fR procude the expected mappings, and that all mappings also produce the expected paths. It basically assures you that your paths are roundtrippable, so that you can be confident in them. .SH "BUGS" .IX Header "BUGS" All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT. .SH "AUTHOR" .IX Header "AUTHOR" Stevan Little .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2008\-2011 Infinity Interactive, Inc. .PP .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHOR" .IX Header "AUTHOR" Stevan Little .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2016 by Infinity Interactive. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.