| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use Test::More; |
| 4 |
use Test::Fatal; |
| 5 |
use Plack::Test; |
| 6 |
|
| 7 |
eval { require Test::Memory::Cycle; 1; } |
| 8 |
or plan skip_all => 'Test::Memory::Cycle not present'; |
| 9 |
|
| 10 |
{ |
| 11 |
|
| 12 |
package MyApp::Cycles; |
| 13 |
use Dancer2; |
| 14 |
|
| 15 |
set auto_page => 1; |
| 16 |
set serializer => 'JSON'; |
| 17 |
|
| 18 |
get '/**' => sub { |
| 19 |
return { hello => 'world' }; |
| 20 |
}; |
| 21 |
} |
| 22 |
|
| 23 |
my $app = MyApp::Cycles->to_app; |
| 24 |
|
| 25 |
my $runner = Dancer2->runner; |
| 26 |
Test::Memory::Cycle::memory_cycle_ok( $runner, "runner has no memory cycles" ); |
| 27 |
Test::Memory::Cycle::memory_cycle_ok( $app, "App has no memory cycles" ); |
| 28 |
|
| 29 |
done_testing(); |