5 package t::Web::Simple::MatchHome;
10 [200, ['Content-Type' => 'text/plain'],
11 [$_[0]->{REQUEST_METHOD}, $_[0]->{REQUEST_URI}] ]
14 sub dispatch_request {
16 sub (~) { as_text(pop) },
17 sub (/bar) { as_text(pop) },
18 sub (/baz) { as_text(pop) },
19 sub (/*) { as_text(pop) },
21 sub (~) { as_text(pop) },
22 sub (/bar) { as_text(pop) },
26 sub (/baz) { as_text(pop) },
28 sub (~) { as_text(pop) },
29 sub (/bar) { as_text(pop) },
35 ok my $app = t::Web::Simple::MatchHome->new,
38 for(ok my $res = $app->run_test_request(GET => '/foo')) {
39 is $res->content, 'GET/foo';
42 for(ok my $res = $app->run_test_request(GET => '/foo/bar')) {
43 is $res->content, 'GET/foo/bar';
46 for(ok my $res = $app->run_test_request(GET => '/foo/baz')) {
47 is $res->content, 'GET/foo/baz';
50 for(ok my $res = $app->run_test_request(GET => '/foo/id')) {
51 is $res->content, 'GET/foo/id';
55 for(ok my $res = $app->run_test_request(GET => '/foo/bork')) {
56 is $res->content, 'GET/foo/bork';
59 for(ok my $res = $app->run_test_request(GET => '/foo/bork/bar')) {
60 is $res->content, 'GET/foo/bork/bar';
63 for(ok my $res = $app->run_test_request(GET => '/fob')) {
64 is $res->content, 'GET/fob';
67 for(ok my $res = $app->run_test_request(GET => '/baz')) {
68 is $res->content, 'GET/baz';
71 for(ok my $res = $app->run_test_request(GET => '/fob/bar')) {
72 is $res->content, 'GET/fob/bar';