pp (@apps) {
is( $cb->( GET "/$app" )->content, $app, "App$app available" );
}
}
sub isnt_available {
my ( $cb, @apps ) = @_;
foreach my $app (@apps) {
is(
$cb
' );
test_psgi $app, sub {
my $cb = shift;
is_available( $cb, 1, 3 );
isnt_available( $cb, 2 );
};
}
note 'Specific Apps via App objects'; {
my $app = App2->psgi_a
app' );
test_psgi $app, sub {
my $cb = shift;
is_available( $cb, 2 );
isnt_available( $cb, 1, 3 );
};
};
note 'Specific apps by App names'; {
my $app = Dancer2->ps
pp (@apps) {
is( $cb->( GET "/$app" )->content, $app, "App$app available" );
}
}
sub isnt_available {
my ( $cb, @apps ) = @_;
foreach my $app (@apps) {
is(
$cb
' );
test_psgi $app, sub {
my $cb = shift;
is_available( $cb, 1, 3 );
isnt_available( $cb, 2 );
};
}
note 'Specific Apps via App objects'; {
my $app = App2->psgi_a
app' );
test_psgi $app, sub {
my $cb = shift;
is_available( $cb, 2 );
isnt_available( $cb, 1, 3 );
};
};
note 'Specific apps by App names'; {
my $app = Dancer2->ps
ion cookie set again');
# extract SID
$jar->scan(sub { $sid2 = $_[2] });
isnt $sid2, $sid1, "New session has different ID";
is $res->content, $sid2, "new session ID re
'session cookie set');
# extract SID
$jar->scan(sub { $sid3 = $_[2] });
isnt $sid3, $sid2, "New session has different ID";
};
subtest "[$engine] Destroy and create a
ing, 'session cookie set');
my $sid4;
$jar->scan(sub { $sid4 = $_[2] });
isnt $sid4, $sid3, "Changed session has different ID";
};
subtest "[$engine] Read value back"
$_ => 'fighter', "response_content_is with $_" for @routes;
response_content_isnt $_ => 'platypus', "response_content_isnt with $_"
for @routes;
response_content_like $_ => qr/igh/ for @routes;
_unlike $_ => qr/ought/ for @routes;
response_status_is $_ => 200 for @routes;
response_status_isnt $_ => 203 for @routes;
response_headers_include $_ => [ Server => "Perl Dancer2 " . Dancer2->VER
ot error');
my $refaddr3 = $res3->decoded_content;
isnt($refaddr1, $refaddr3, 'The 3rd request has a different with_return from the first run');
isnt($refaddr2, $refaddr3, 'The 3rd request has a diffe
'session cookie set again');
my $sid;
$jar->scan(sub { $sid = $_[2] });
isnt $sid, 'abcdefghijklmnopqrstuvwxyz123456',
"Session ID has been reset";
};
}
subtes
control test)',
);
};
eval 'my $var; my $var;';
my $str = "щука";
::isnt( length $str, 4, 'utf8 pragma not imported' );
}
{
package App::StrictAndWarningsAndUTF8;
my $res = $test->request( GET '/content' );
ok( $res->is_success, 'Successful request' );
isnt( $res->content, 'this is ignored', 'route return value ignored' );
is( $res->content, '{"foo"
k($res3->is_success, '/normal_route does not error');
my $session_value = $res3->decoded_content;
isnt($session_value, "I SHOULD NOT BE IN THE NEXT SESSION",
'3rd route does not have session valu
t');
is($s1->id, "new_$id", '... new value found for id');
my $s2 = $ENGINE->create;
isnt($s1->id, $s2->id, "IDs are not the same");
};
my $count = 10_000;
subtest "$count session IDs an