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', |
|
14 ); |
|
15 |
|
16 plan tests => scalar(@users) + 2; |
|
17 |
|
18 foreach my $username (@users) { |
|
19 my $conn = TestConnection->new($username); |
|
20 |
|
21 $conn->reg_cb(session_ready => sub { |
|
22 $conn->cond->send; |
|
23 }); |
|
24 |
|
25 my $error = $conn->cond->recv; |
|
26 ok(! $error) or diag($error); |
|
27 } |
|
28 |
|
29 do { |
|
30 my $conn = TestConnection->new('one', password => '23451'); |
|
31 |
|
32 $conn->reg_cb(session_ready => sub { |
|
33 $conn->cond->send; |
|
34 }); |
|
35 |
|
36 my $error = $conn->cond->recv; |
|
37 ok($error); |
|
38 }; |
|
39 |
|
40 do { |
|
41 my $conn = TestConnection->new('six', password => '12345'); |
|
42 |
|
43 $conn->reg_cb(session_ready => sub { |
|
44 $conn->cond->send; |
|
45 }); |
|
46 |
|
47 my $error = $conn->cond->recv; |
|
48 ok($error); |
|
49 }; |