view mod_lib_ldap/dev/t/00-login.t @ 857:1393af36ec9c

mod_websocket: Determine whether to use a self-closing stream tag, based on the client's initial data
author Florian Zeitz <florob@babelmonkeys.de>
date Thu, 08 Nov 2012 01:55:00 +0100
parents 1d51c5e38faa
children 8495dae58d78
line wrap: on
line source

use strict;
use warnings;
use lib 't';

use TestConnection;
use Test::More;

my @users = (
    'one',
    'two',
    'three',
    'four',
    'five',
);

plan tests => scalar(@users) + 2;

foreach my $username (@users) {
    my $conn = TestConnection->new($username);

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok(! $error) or diag($error);
}

do {
    my $conn = TestConnection->new('one', password => '23451');

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok($error);
};

do {
    my $conn = TestConnection->new('six', password => '12345');

    $conn->reg_cb(session_ready => sub {
        $conn->cond->send;
    });

    my $error = $conn->cond->recv;
    ok($error);
};