File: bug21981.todo

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 (45 lines) | stat: -r--r--r-- 924 bytes parent folder | download | duplicates (7)
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
use encoding 'utf8';
use strict;

use File::Spec;
use Test::More ('no_plan');

BEGIN {
    use_ok('CGI::Session');
    use_ok("CGI::Session::Driver");
    use_ok("CGI::Session::Driver::file");
}

my $id;
my $s;

{
    ok($s = CGI::Session->new('driver:file;serializer:default', undef), 'Created CGI::Session object successfully');

    $id = $s -> id();
}

diag("Warnings expected. Consult docs re 'utf8'");
ok($id, 'Session created successfully');

# Emulate CGI::Session::Driver::file.pm.

my $dir_name  = File::Spec->tmpdir();
my $file_name = File::Spec->catfile($dir_name, "cgisess_$id");

$s = undef;

{
    $s = CGI::Session->new('driver:file;serializer:default', $id);
}

if ($@) {
    print STDERR $@;
    ok(1, q|Warning: Failed to recreate session. Cannot "use 'utf8'; in conjunction with CGI::Session"|);
} else {
    ok($s, 'Recreated session succeeded');
}

# Clean up /tmp as per RT 29969.

unlink $file_name;