File: parameters-leak.t

package info (click to toggle)
libplack-middleware-debug-perl 0.18%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 284 kB
  • sloc: perl: 599; javascript: 133; makefile: 8; sql: 5
file content (44 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use strict;
use warnings FATAL => 'all';

use Test::Requires qw(Test::LeakTrace);
use Plack::Test;
use Plack::Builder;
use HTTP::Request::Common qw(GET);
use Test::More;

ok (
  my $app = sub {
    return [
      200, [ 'Content-Type' => 'text/html' ],
      ['<body>Hello World</body>']
    ];
  },
  'Created an application to test',
);

ok (
  $app = builder {
    enable 'Debug', panels => ['Parameters'];
    $app;
  },
  'Enabled the "Parameters" panel',
);

ok (
  my $cb = sub {
    shift->(GET '/');
  },
  'Created callback function for test_psgi',
);

no_leaks_ok (
  sub {
    for (1..5) {
      test_psgi $app, $cb;
    }
  }, 
  'No leaks in application',
);

done_testing;