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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
# $Id: complex_ds.t,v 1.2 2002/11/22 13:09:21 sherzodr Exp $
use strict;
BEGIN {
use Test::More tests => 10;
};
# Insert your test code below, the Test module is use()ed here so read
# its man page ( perldoc Test ) for help writing this test script.
use CGI::Session;
my $s = CGI::Session->new('driver:File',undef, {Directory=>"t"} ) or die $CGI::Session::errstr;
ok($s);
ok($s->id());
my $d1 = [qw(1 2 3 4 5 6)];
my $d2 = {1 => "Bir", 2 => "Ikki", 3=>"Uch", 4=>"To'rt", 5=>"Besh", 6=>"Olti"};
my $d3 = {
d1 => $d1,
d2 => $d2
};
$s->param(d3 => $d3);
ok($s->param('d3'));
ok( $s->param('d3')->{d1}->[0], 'Test 1');
ok( $s->param('d3')->{d1}->[1], 'Test 2');
ok( $s->param('d3')->{d2}->{1}, 'Bir');
my $sid = $s->id();
$s->flush();
eval {
my $s1 = CGI::Session->new('driver:File',$sid, {Directory=>"t"})
or die $CGI::Session::errstr;
ok($s1->param('d3'));
ok( $s1->param('d3')->{d1}->[0], 'Test 1');
ok( $s1->param('d3')->{d1}->[1], 'Test 2');
ok( $s1->param('d3')->{d2}->{1}, 'Bir');
$s1->delete();
};
warn $@ if $@;
|