File: load.t

package info (click to toggle)
libcgi-session-perl 4.48-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 616 kB
  • sloc: perl: 1,920; makefile: 5
file content (25 lines) | stat: -r--r--r-- 743 bytes parent folder | download | duplicates (4)
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
# $Id$

use strict;


use Test::More 'no_plan';

# Some driver independent tests for load();

use CGI::Session;

{
    my $s = CGI::Session->load('Driver:file;serial:FreezeThaw',undef, Directory=> 'wrong' );
    is($s,undef, "undefined session is created with wrong number of args to load");
    like(CGI::Session->errstr, qr/Too many/, "expected error is returned for too many args");
    unlike(CGI::Session->errstr, qr/new/, "don't mention new() in error when load() fails directly.");
}
{
    my $s = CGI::Session->new();
    is(CGI::Session->errstr, '', "reality check: no error when calling new()");
    $s->load();
    like($s->errstr, qr/instance method/, "expected error when load() called as instance method.");
    $s->delete();
}