Mercurial > prosody-modules
annotate mod_lib_ldap/dev/t/00-login.t @ 4300:3f3b672b7616
mod_vcard_muc: Pass room object around instead of JID, hopefully fixing traceback
More efficient to pass the object around instead of using the JID
and looking up the object when needed.
It seems in some (undetermined) cases get_room_from_jid(room.jid) is nil.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 15 Dec 2020 10:49:11 +0000 |
parents | 512e31cd8b70 |
children |
rev | line source |
---|---|
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 | |
874 | 17 plan tests => scalar(@users) + 3; |
809 | 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; | |
867
a93cb608db2c
Print the username if a test login fails
Rob Hoelz <rob@hoelz.ro>
parents:
866
diff
changeset
|
27 ok(! $error) or diag("$username login failed: $error"); |
809 | 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 { | |
876
512e31cd8b70
Fix login failure test to use a non-existent user
Rob Hoelz <rob@hoelz.ro>
parents:
874
diff
changeset
|
42 my $conn = TestConnection->new('invalid', password => '12345'); |
809 | 43 |
44 $conn->reg_cb(session_ready => sub { | |
45 $conn->cond->send; | |
46 }); | |
47 | |
48 my $error = $conn->cond->recv; | |
49 ok($error); | |
50 }; | |
874 | 51 |
52 do { | |
53 my $conn = TestConnection->new('seven', password => '1234567'); | |
54 | |
55 $conn->reg_cb(session_ready => sub { | |
56 $conn->cond->send; | |
57 }); | |
58 | |
59 my $error = $conn->cond->recv; | |
60 ok($error); | |
61 }; |