809
|
1 use strict; |
|
2 use warnings; |
|
3 use lib 't'; |
|
4 |
|
5 use TestConnection; |
|
6 use Test::More; |
|
7 |
|
8 my @users = ( |
|
9 'one', |
|
10 'two', |
|
11 'three', |
|
12 'four', |
|
13 'five', |
866
|
14 'six', |
809
|
15 ); |
|
16 |
|
17 plan tests => scalar(@users) + 2; |
|
18 |
|
19 foreach my $username (@users) { |
|
20 my $conn = TestConnection->new($username); |
|
21 |
|
22 $conn->reg_cb(session_ready => sub { |
|
23 $conn->cond->send; |
|
24 }); |
|
25 |
|
26 my $error = $conn->cond->recv; |
|
27 ok(! $error) or diag($error); |
|
28 } |
|
29 |
|
30 do { |
|
31 my $conn = TestConnection->new('one', password => '23451'); |
|
32 |
|
33 $conn->reg_cb(session_ready => sub { |
|
34 $conn->cond->send; |
|
35 }); |
|
36 |
|
37 my $error = $conn->cond->recv; |
|
38 ok($error); |
|
39 }; |
|
40 |
|
41 do { |
|
42 my $conn = TestConnection->new('six', password => '12345'); |
|
43 |
|
44 $conn->reg_cb(session_ready => sub { |
|
45 $conn->cond->send; |
|
46 }); |
|
47 |
|
48 my $error = $conn->cond->recv; |
|
49 ok($error); |
|
50 }; |