File: 06_nest.t

package info (click to toggle)
libtest-tcp-perl 2.00-1~bpo70%2B1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 204 kB
  • sloc: perl: 233; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 611 bytes parent folder | download | duplicates (3)
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
use strict;
use warnings;
use Test::TCP;
use Test::More tests => 1;
use t::Server;

test_tcp(
    client => sub {
        my $port1 = shift;
        test_tcp(
            client => sub {
                my $port2 = shift;
                isnt $port1, $port2, "$port1, $port2";
            },
            server => sub {
                my $port2 = shift;
                t::Server->new($port2)->run;
            },
        );
    },
    server => sub {
        my $port1 = shift;
        t::Server->new($port1)->run;
    },
);

if ($?) {
    diag "test_tcp() leaks \$?. Maybe it's Perl bug?: $?";
    $? = 0;
}